File 'app/hero.ts' is not a module error in the console, where to store interfaces files in directory structure with angular2?

后端 未结 24 1831
无人共我
无人共我 2020-12-13 07:55

I am doing the angular2 tutorial at this address: https://angular.io/docs/ts/latest/tutorial/toh-pt3.html I have put the hero interface in a single

24条回答
  •  囚心锁ツ
    2020-12-13 08:42

    This error is caused by failer of the ng serve serve to automatically pick up a newly added file. To fix this, simply restart your server.

    Though closing the reopening the text editor or IDE solves this problem, many people do not want to go through all of the stress of reopening the project. To Fix this without closing the text editor...

    In terminal where the server is running,

    • Press ctrl+C to stop the server then,
    • Start the server again: ng serve

    That should work.

提交回复
热议问题