2016-12-20 29 views
0

下面plunker鏈路使用角2測試版的代碼,它可以完美運行,塊UI單擊

<head> 
<title>angular2 spinner</title> 
<link rel="stylesheet" href="src/spinner.css" /> 
<script src="https://code.angularjs.org/2.0.0-beta.11/angular2-polyfills.js"></script> 
<script src="https://code.angularjs.org/tools/system.js"></script> 
<script src="https://code.angularjs.org/tools/typescript.js"></script> 
<script src="config.js"></script> 
<script src="https://code.angularjs.org/2.0.0-beta.11/Rx.js"></script> 
<script src="https://code.angularjs.org/2.0.0-beta.11/angular2.min.js"></script> 
<script src="https://code.angularjs.org/2.0.0-beta.11/http.min.js"></script> 
<script> 
System.import('app') 
    .catch(console.error.bind(console)); 

http://plnkr.co/edit/Y2ocRpbi2ORjbULrguDg?p=preview

現在我試圖複製相同與Angular版本2.0.X,但大多數的東西都從RC版本改變。

下面是我當前plunker代碼鏈接,

http://plnkr.co/edit/f6GBBQan7z4I9K1qBZOi?p=preview

我是很新的角度2,請幫我解決這個問題。

謝謝,

回答

0

我分叉你的闖入者。你有一些問題。作爲未來的參考,提供必要的代碼,因爲鏈接可能會改變。這裏是搶劫犯,我會指出錯誤。錯誤也在plunker中標出。 Plunker

您有一些導入問題。從角導入時,它應該是@angular/core,不@angular2/core

供應商在@Component不需要了,因爲你爲他們提供@NgModule

你的路,有時在你創建的組件的進口錯誤。 您已將它們標記爲./src/spinner.component,從導入中刪除src/

您錯過了entryComponents: [SpinnerComponent]您的@NgModule