我尝试设置angular2,但我的自定义html标签未处理。
我想知道如何让事情运转起来......有点令人困惑。
我提供了一些代码,所以你们可以看到!
应用/ main.ts
import { bootstrap } from 'angular2/platform/browser';
import { AppComponent } from './app.component';
bootstrap(AppComponent);
应用/ app.component.ts
import { Component } from 'angular2/core';
@Component({
selector: 'timo',
template: '<h1>Sample Text</h1>'
})
export class AppComponent { }
的index.html
<!DOCTYPE html>
<html>
<head>
<title>Sample Site</title>
<script src="node_modules/systemjs/dist/system.js"></script>
<script src="node_modules/rxjs/bundles/Rx.js"></script>
<script src="node_modules/angular2/bundles/angular2.dev.js"></script>
<script>
System.config({
packages: { app: { defaultExtension: 'js' }}
});
System.import('./app/main');
</script>
</head>
<body>
<timo>loading ...</timo>
</body>
</html>
的package.json
{
"name": "workspace",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"angular2": "^2.0.0-beta.17",
"es6-shim": "^0.35.1",
"reflect-metadata": "^0.1.2",
"rxjs": "^5.0.0-beta.6",
"systemjs": "^0.19.31",
"zone.js": "^0.6.12"
},
"devDependencies": {
"typescript": "^1.8.10"
}
}
所有显示的只是&#34; ... loading&#34;。