So maybe this is a total noob question, but I am a total noob at Angular JS and TypeScript. I'm going through Angular's hero tutorial (There's a Plunker for it here: https://angular.io/resources/live-examples/toh-1/ts/plnkr.html). If the Hero class is defined at the beginning (after the import line) or end of the file, it runs fine; however, if it's defined in between @Component and AppComponent, the JS throws the following exception at runtime: "No Directive annotation found on AppComponent". I don't understand enough about TypeScript and/or Angular JS to satisfactorily understand why this is. Why is the order so important? Do I need to add some special syntax when the Hero definition is in the middle? Thanks!
Join the Stack Overflow Community
Stack Overflow is a community of 6.7 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up
Join them; it only takes a minute:
When you have the |
|||||
|