angularjs2 公共部分

import {bootstrap} from 'angular2/platform/browser';


import {AppComponent} from './app';

bootstrap(AppComponent).catch(err => console.error(err));

/*
Copyright 2016 Google Inc. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://angular.io/license
*/

import {bootstrap}        from 'angular2/platform/browser';
import {ROUTER_PROVIDERS} from 'angular2/router';

import {AppComponent}     from './app';

// Add these symbols to override the `LocationStrategy`
//import {provide}           from 'angular2/core';
//import {LocationStrategy,//        HashLocationStrategy} from 'angular2/router';

bootstrap(AppComponent,[ROUTER_PROVIDERS,//provide(LocationStrategy,//       {useClass: HashLocationStrategy}) // .../#/crisis-center/
]);


/*
 Copyright 2016 Google Inc. All Rights Reserved.
 Use of this source code is governed by an MIT-style license that
 can be found in the LICENSE file at http://angular.io/license
 */


<!DOCTYPE html>
<html>
  <head>
    <title>Angular 2 Demo</title>
    <Meta name="viewport" content="width=device-width,initial-scale=1">

    <!-- IE required polyfills,in this exact order -->
    <script src="lib/es6-shim.min.js"></script>
    <script src="lib/system-polyfills.js"></script>
    <script src="lib/shims_for_IE.js"></script>

    <script src="lib/angular2-polyfills.js"></script>
    <script src="lib/system.js"></script>
    <script src="lib/typescript.js"></script>
    <script src="lib/Rx.js"></script>
    <script src="lib/angular2.dev.js"></script>
    <script>
      System.config({
        transpiler: 'typescript',typescriptOptions: { emitDecoratorMetadata: true },packages: {'app': {defaultExtension: 'ts'}} 
      });
      System.import('app/main')
            .then(null,console.error.bind(console));
    </script>
  </head>

  <body>
    <my-app>Loading...</my-app>
  </body>

</html>

<!-- 
Copyright 2016 Google Inc. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://angular.io/license
-->


<!DOCTYPE html>
<html>
<head>
  <!-- Set the base href -->
  <script>document.write('<base href="' + document.location + '" />');</script>

  <Meta name="viewport" content="width=device-width,initial-scale=1">
  <link rel="stylesheet" href="styles.css">

  <!-- IE required polyfills,in this exact order -->
  <script src="lib/es6-shim.min.js"></script>
  <script src="lib/system-polyfills.js"></script>
  <script src="lib/shims_for_IE.js"></script>

  <script src="lib/angular2-polyfills.js"></script>
  <script src="lib/system.js"></script>
  <script src="lib/typescript.js"></script>
  <script src="lib/Rx.js"></script>
  <script src="lib/angular2.dev.js"></script>

  <!-- Add the router library -->
  <script src="lib/router.dev.js"></script>

  <script>
    System.config({
      transpiler: 'typescript',packages: {'app': {defaultExtension: 'ts'}}
    });
    System.import('app/main')
            .then(null,console.error.bind(console));
  </script>
</head>

<body>
<my-app>loading...</my-app>
</body>

</html>


<!-- 
Copyright 2016 Google Inc. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://angular.io/license
-->

相关文章

AngularJS 是一个JavaScript 框架。它可通过 注:建议把脚本放在 元素的底部。这会提高网页加载速度,因...
angluarjs中页面初始化的时候会出现语法{{}}在页面中问题,也即是页面闪烁问题。出现这个的原因是:由于...
AngularJS 通过被称为指令的新属性来扩展 HTML。AngularJS 指令AngularJS 指令是扩展的 HTML 属性,带有...
AngularJS 使用表达式把数据绑定到 HTML。AngularJS 表达式AngularJS 表达式写在双大括号内:{{ expres...
ng-repeat 指令可以完美的显示表格。在表格中显示数据 {{ x.Name }} {{ x.Country }} 使用 CSS 样式为了...
$http是 AngularJS 中的一个核心服务,用于读取远程服务器的数据。读取 JSON 文件下是存储在web服务器上...