我必须创建Login Page,但在我做之前,我尝试使用简单的HTTP get with JSON对象。但该页面无法加载 enter image description here
在一些帖子中我读到如果我在index.html中写这行就可以解决#{1}}
(index):18 Error: (SystemJS) XHR error (404 Not Found) loading

,但它没有加载。我试过了
<script src="node_modules/angular2/bundles/http.dev.js"></script>
&#13;
但没有任何帮助。在我的导入中,我有@angular stead angular2
hier是我的package.json
<script src="node_modules/@angular/bundles/http.dev.js"></script>
&#13;
和我的代码 https://gist.github.com/anonymous/d3b5f00ed5e9a5d3db603bf6eafb402f 和 https://gist.github.com/anonymous/d6940887480a6501a539fa15f8de6b9f
非常感谢你的帮助
答案 0 :(得分:0)
您需要将HttpModule
导入模块。
<强> app.module.ts 强>
import { HttpModule } from '@angular/http'; // add this line
@NgModule({
imports: [
//....
HttpModule //make sure you import `HttpModule` into `NgModule`
],
// ...
)}