当我将这行代码添加到我的@Component中时:
directives: [HeroDetailComponent]@H_403_2@GET http://localhost:3000/@angular/core 404 (Not Found)@H_403_2@这些是我的index.html中的脚本:
<script src="node_modules/es6-shim/es6-shim.min.js"></script> <script src="node_modules/systemjs/dist/system-polyfills.js"></script> <script src="node_modules/angular2/es6/dev/src/testing/shims_for_IE.js"></script> <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>@H_403_2@如果我错过了诊断此问题的任何信息,请告诉我,我会将其包含在此处.
如果要使用RC版本的Angular2,则需要以这种方式配置SystemJS:
原文链接:https://www.f2er.com/angularjs/143307.htmlvar packages = { 'app': { main: 'main.js',defaultExtension: 'js' },'rxjs': { defaultExtension: 'js' },'angular2-in-memory-web-api': { defaultExtension: 'js' },}; var packageNames = [ '@angular/common','@angular/compiler','@angular/core',// <-------- '@angular/http','@angular/platform-browser','@angular/platform-browser-dynamic','@angular/router','@angular/router-deprecated','@angular/testing','@angular/upgrade',]; packageNames.forEach(function(pkgName) { packages[pkgName] = { main: 'index.js',defaultExtension: 'js' }; }); var config = { map: map,packages: packages } System.config(config);@H_403_2@如果要使用beta版本,在脚本元素中包含node_modules / angular2 / bundles / angular2.dev.js文件后,请导入此包:
import {Component,Directive,...} from 'angular2/core';@H_403_2@