[英]Angular2 ExceptionHandler - check if error object is Response
[英]Angular2 - No provider for ExceptionHandler
我想在我的PHP應用程序中集成angular2。 以下是我執行的步驟
../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
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和angular 2存在沖突。請參閱pluker: http ://plnkr.co/edit/XKKpriTPrTX3tXqqz8v2?p = preview
我有幾次這個錯誤。 根據這個: Angular Quickstart
您可能會遺漏幾個腳本:
<script src="node_modules/es6-shim/es6-shim.min.js"></script>
<script src="node_modules/systemjs/dist/system-polyfills.js"></script>
如果使用Internet Explorer,您還應該記得包括:
<script src="node_modules/angular2/es6/dev/src/testing/shims_for_IE.js"></script>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.