簡體   English   中英

我的Angular2網站未使用Angular2-cli更新

[英]My Angular2 website doesnt update using Angular2-cli

我在angular2中構建了一個小型應用程序,並嘗試使用webstorm修改文件以查看其是否在瀏覽器中更新。

我做了以下工作,到目前為止沒有錯誤:

npm i -g angular-cli
ng new ponyracer
ng serve   (working on background)

在此文件中,我將“ PonyRacer4566”更改為“ dshbhs”,但是瀏覽器中沒有任何更新。

import {Component} from 'angular2/core';
@Component({
    selector: 'ponyracer-app',
    template: '<h1>PonyRacer4566</h1>'
})
export class PonyRacerApp {
}

更新文件時,您是否在終端中看到任何消息? 它是否表示文件已更改且構建已完成?

如果您認為這是angular-cli的問題,可以將其提交到官方存儲庫:github.com/angular/angular-cli。

我必須將這些行添加到index.html中才能正常工作。

<script src="vendor/es6-shim/es6-shim.js"></script>
  <script src="vendor/systemjs/dist/system-polyfills.js"></script>
  <script src="vendor/angular2/bundles/angular2-polyfills.js"></script>
  <script src="vendor/systemjs/dist/system.src.js"></script>
  <script src="vendor/rxjs/bundles/Rx.js"></script>

  <script src="vendor/angular2/bundles/angular2.dev.js"></script>
  <script src="vendor/angular2/bundles/http.dev.js"></script>
  <script src="vendor/angular2/bundles/router.dev.js"></script>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM