I want to compile ahead-of-time using the latest version Angular's offline compiler. I updated all the necessary packages to RC5, have the latest version of the compiler, etc.
But then I got a bunch of errors such as:
I noticed from http://www.syntaxsuccess.com/viewarticle/offline-compilation-in-angular-2.0 that it may be necessary to include common directives in the @Component decorator. But it looks like this has been fixed since RC5: https://github.com/angular/angular/blob/master/CHANGELOG.md. And the error I'm getting when I try this seems to suggest this is no longer necessary:
Type NgIf is part of the declarations of 2 modules: CommonModule and AppModule!
I can also compile and run the site normally using tsc and RC5, so it isn't an upgrading issue. So I'm totally at a loss as to what may be causing these errors.
Any help is much appreciated.
The solution was very trivial. I was just missing BrowserModule from the @NgModule imports in AppModule.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With