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
angular2
hero
Open command prompt, go to the app folder, e.g. D:\angular-tour-of-heroes\src\app
D:\angular-tour-of-heroes\src\app
Then create a new file using the following command:
ng generate class hero
This will create a hero.ts file. Then you can paste the export code, and the error is gone.
hero.ts