0

我正在尝试设置 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 { }

索引.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>

包.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"
  }
}

所显示的只是“......加载”。

4

0 回答 0