joaogarin / angular-electron

Angular2 and Electron starter using webpack
150 stars 53 forks source link

There is an error,please add a @NgModule annotation. #75

Closed ychost closed 7 years ago

ychost commented 7 years ago

Uncaught Error: Unexpected directive 'MdSlideToggle' imported by the module 'AppModule'. Please add a @NgModule annotation.

ddamko commented 7 years ago

Same here and it looks like it is related to AOT with Angular 4. See the issue raised here: https://github.com/angular/angular-cli/issues/6429

And the solution was linked to here: https://github.com/angular/angular-cli/blob/master/docs/documentation/stories/linked-library.md

joaogarin commented 7 years ago

Hello,

So, Sorry this was my bad. But was actually a simple one. The problem is I was importing the

MdSlideToggle (directive)

as if it was a module, but what should be imported is :

MdSlideToggleModule

The fix is here : https://github.com/joaogarin/angular-electron/commit/58c90ab9a4b3df44423ea9fed96e977b722a0dfc

Thanks for the feedback I will close it now;)