如何删除angular2种子中未找到的文件?
我正在尝试在angular 2中创建hello world。我正在使用 我做了下面的事情 使用如何删除angular2种子中未找到的文件?,angular,angular2-routing,angular2-template,Angular,Angular2 Routing,Angular2 Template,我正在尝试在angular 2中创建hello world。我正在使用 我做了下面的事情 使用npm init创建package.json文件,然后安装所有npm包。这是我的package.json文件: { "name": "testwell", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test spec
npm init
创建package.json
文件,然后安装所有npm包。这是我的package.json文件:
{
"name": "testwell",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"ts-loader": "^0.7.2",
"typescript": "^1.7.3",
"webpack": "^1.12.9",
"webpack-dev-server": "^1.14.0"
},
"dependencies": {
"angular2": "2.0.0-beta.0",
"es6-promise": "3.0.2",
"es6-shim": "0.33.3",
"reflect-metadata": "0.1.2",
"rxjs": "5.0.0-beta.0",
"zone.js": "0.5.10"
}
}
然后我制作了一个tsconfig.json
文件:
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"noImplicitAny": false,
"outDir": "dist",
"rootDir": ".",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"moduleResolution": "node"
},
"exclude": [
"node_modules"
]
}
然后我创建了一个webpack.config.js
文件,在那里我实际复制了它
然后我创建了一个app
目录,并在其中创建了app.ts
:
import {Component} from 'angular2/core';
@Component({
selector: 'my-app',
template: '<h1>My First Angular 2 App</h1>'
})
export class AppComponent { }
import {bootstrap} from 'angular2/platform/browser';
import {AppComponent} from './app';
bootstrap(AppComponent)
.catch(err => console.error(err));
import 'angular2/bundles/angular2-polyfills';
import 'angular2/platform/browser';
import 'angular2/core';
import 'angular2/http';
import 'angular2/router';
在vendor.ts
中:
import {Component} from 'angular2/core';
@Component({
selector: 'my-app',
template: '<h1>My First Angular 2 App</h1>'
})
export class AppComponent { }
import {bootstrap} from 'angular2/platform/browser';
import {AppComponent} from './app';
bootstrap(AppComponent)
.catch(err => console.error(err));
import 'angular2/bundles/angular2-polyfills';
import 'angular2/platform/browser';
import 'angular2/core';
import 'angular2/http';
import 'angular2/router';
在index.html
中:
<!DOCTYPE html>
<html>
<head>
<meta charset=UTF-8>
<title>Angular2 Seed</title>
<base href="/">
</head>
<body>
<my-app>loading...</my-app>
<script src="vendor.bundle.js"></script>
<script src="bundle.js"></script>
</body>
</html>
角2种子
加载。。。
这是我的密码:
我得到这个错误:
未找到vendor.bundle.js和bundle.js文件
以下是目录的屏幕截图:
如何删除此错误您在哪里看到此错误?你启动了开发服务器吗?你的标题有误导性,请更改它否…如何启动开发服务?我在控制台上看到错误。我正在使用webstrom编辑器..当我打开index.html文件..在chrome上运行时,给控制台找不到错误文件