我想在我的PHP应用程序中整合angular2。 下面是已经执行Angular2 - 没有提供ExceptionHandler
- 包括必要JS以下步骤:
../node_modules/angular2/bundles/angular2-polyfills.js ../node_modules/systemjs/dist/system.src.js ../node_modules/typescript/lib/typescript.js ../node_modules/rxjs/bundles/Rx.js ../node_modules/angular2/bundles/angular2.dev.js
- 创建angular2在打字稿组分:
- 配置:
- 自举:
import {Component} from 'angular2/core'; @Component({ selector: 'hello-world', template: 'My First Angular 2 App' })
export class AppComponent { }
<script> System.config({ transpiler: 'typescript', typescriptOptions: { emitDecoratorMetadata: true } }); </script>
<script> System.import('angular2/platform/browser').then(function(ng){ System.import('js/app.ts').then(function(src) { ng.bootstrap(src.AppComponent); }).then(null, console.error.bind(console)); }); </script>
编辑:
似乎有与的prototype.js冲突和角2.见pluker:http://plnkr.co/edit/XKKpriTPrTX3tXqqz8v2?p=preview
有seprate垫片文件为每像IE浏览器? –
@PardeepJain不是我意识到的,但你可以查看该文件夹中的文件,看看有什么:) – Rick
@PardeepJain:不,没有。这个为IE11的原因可以从该文件内容中找到。例如,'function.name'在所有其他主流浏览器上都能正常工作,但不能在IE中使用。 [Here's](http://stackoverflow.com/q/6903762)更多详情。 –