1
我是angular2的新手。angular2無法找到共同指令
import {FORM_DIRECTIVES,NgForm} from 'angular2/common';
我得到的錯誤是:
system.src.js:1063在我的HTML頁面的頭部GET http://127.0.0.1:9090/src/angular2/common 404(未找到)
我是angular2的新手。angular2無法找到共同指令
import {FORM_DIRECTIVES,NgForm} from 'angular2/common';
我得到的錯誤是:
system.src.js:1063在我的HTML頁面的頭部GET http://127.0.0.1:9090/src/angular2/common 404(未找到)
利用這種配置,它適用於我:
<script src="node_modules/angular2/bundles/angular2-polyfills.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="node_modules/rxjs/bundles/Rx.js"></script>
<script src="node_modules/angular2/bundles/angular2.dev.js"></script>
<script>
System.config({
packages: {
app: {
format: 'register',
defaultExtension: 'js'
}
}
});
System.import('app/boot')
.then(null, console.error.bind(console));
</script>
希望它可以幫助你, Thierry
什麼是您的System.js配置,以及您在index.html中加載的angular2文件是什麼? –