2016-08-22 71 views
0

我看過ngbook2。我嘗試在angular2上創建hello-world應用程序。如何解決/node_modules/angular2/bundles/angular2.dev.js找不到(404)

,但我得到錯誤404:

GET /node_modules/angular2/bundles/angular2.dev.js 404 5.460毫秒 - 58

app.ts:

import { bootstrap } from "@angular/platform-browser-dynamic"; 
import { Component } from "@angular/core"; 

@Component({ 
    selector: 'hello-world', 
    template: ` 
     <div> 
     Hello world 
     </div> 
     ` 
}) 

class HelloWorld { 


} 

bootstrap(HelloWorld); 

的index.html :

<!doctype html> 
<html> 
    <head> 
     <title>Angular 2 - Simple Reddit</title> 
     <!-- Libraries --> 
     <script src="node_modules/es6-shim/es6-shim.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> 

     <!-- Stylesheet --> 
     <link rel="stylesheet" type="text/css" href="resources/vendor/semantic.min.css"> 
     <link rel="stylesheet" type="text/css" href="styles.css"> 

    </head> 
    <body> 

    <script src="resources/systemjs.config.js"></script> 
    <script> 
     System.import('app.js') 
      .then(null, console.error.bind(console)); 
    </script> 

    <hello-world></hello-world> 

    </body> 
</html> 

模樣的問題是線

但我新手在角度和不知道如何糾正這條線。

我該如何解決這個應用程序?

回答

1

我已閱讀documentation

而且我知道我必須改變圖書館的網址index.html中這些:

<!-- Libraries --> 
<!-- Polyfill(s) for older browsers --> 
<script src="node_modules/core-js/client/shim.min.js"></script> 
<script src="node_modules/zone.js/dist/zone.js"></script> 
<script src="node_modules/reflect-metadata/Reflect.js"></script> 
<script src="node_modules/systemjs/dist/system.src.js"></script> 
相關問題