First angular 2 app

发布时间:2019-07-14 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了First angular 2 app脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

本文毫无意义,仅作记录而已,无需查看。

目录结构
Angular2-quickstart
-app
--app.component.ts
--boot.ts
-index.htML
-license.md

// app.component.ts
import {Component} from 'angular2/core';

@Component({
    selector: 'my-app',
    template: '<h1>;my First Angular 2 App</h1>'
})
export class AppComponent { }

// app.boot.ts
import {bootstrap}    from 'angular2/platform/browser'
import {AppComponent} from './app.component'
bootstrap(AppComponent);

@H_777_55@
// index.html
<html>
<head>
    <title>Angular 2 QuickStart</title>
    <!-- 1. Load libraries -->
    <script src="node_modules/angular2/bundles/angular2-polyfills.js"></script>
    <script src="node_modules/systemjs/dist/system.src.js"></script>
    <script src="node_modules/RxJS/bundles/Rx.js"></script>
    <script src="node_modules/angular2/bundles/angular2.dev.js"></script>
    <!-- 2. Configure SystemJS -->
    <script>
      System.config({
        packages: {        
          app: {
            format: 'register',
            defaultExtension: 'js'
          }
        }
      });
      System.import('app/boot')
            .then(null, console.error.bind(console));
    </script>
  </head>
  <!-- 3. Display the application -->
  <body>
    <my-app>Loading...</my-app>
  </body>
</html>

脚本宝典总结

以上是脚本宝典为你收集整理的First angular 2 app全部内容,希望文章能够帮你解决First angular 2 app所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。