2016-06-08 70 views
3

我加入NG2/CKEDITOR用CMD NPM安裝以及安裝 還有一個例子NG2-CKEditor的 https://www.npmjs.com/package/ng2-ckeditor 我也做了同樣的事情 ,我也添加了這個腳本在我的指數NG2-CKEditor的404(未找到)angular2

<script src="https://cdn.ckeditor.com/4.5.8/standard/ckeditor.js"></script> 

,我打電話觀點,我把<ckedito></ckeditor> 我得到這個錯誤

zone.js:101 GET http://localhost:9000/ng2-ckeditor 404 (Not Found) 

    Error loading http://localhost:9000/ng2-ckeditor as "ng2-ckeditor" from http://localhost:9000/dist/app.component.js 

但我擔心BEC澳洲英語,他們例子中提到:樣品(ES6) 在我tsconfig我有ES5

{ 
    "compilerOptions": { 
    "emitDecoratorMetadata": true, 
    "experimentalDecorators": true, 
    "target": "es5", 
    "module": "system", 
    "moduleResolution": "node", 
    "removeComments": true, 
    "sourceMap": true 
    }, 
    "exclude": [ 
    "node_modules", 
    "typings/main.d.ts", 
    "typings/main" 
    ] 
} 

當我添加這個錯誤directives: [ CKEditor] 感謝我得到

+0

你有'system.config.js'嗎?如果是這樣,請發佈。 – rinukkusu

+0

yeesss我有我的system.config.js –

+1

您必須從node_modules導入'ckeditor',並且必須將其映射到'systemjs.config.js'中。 – micronyks

回答

1

你可以在SystemJS添加此到map塊配置:

'ng2-ckeditor': 'node_modules/ng2-ckeditor/lib/ng2-ckeditor.js' 
+0

我總是得到錯誤 NG2-CKEditor的工作與angular2版本公測 和我的項目angular2 rc1 這是不能引起問題? –

+0

顯然是的!由於包的重命名。例如'angular2/core'在RC中變成'@ angular/core' ... –

+0

我應該在ng2-ckeditor中編輯導入代碼嗎?作爲你寫的例子,就是 ! –