Closed rochapablo closed 7 years ago
I tried to tackle down this issue, but seems to be a mix up with the versions. I've created this component with Angular 2.0, I managed to make it work with this:
Angular: 4.0 Angular CLI: 1.0 (Demo page is like that)
But not with Angular 4.2-rc.1, found similar issue here but not clear solution. For now I'll stick with 4.0 since 4.2 is rc. Eventually I should rewrite the component for Angular 4. Help's welcome ;)
Changing to angular2-bootstrap-switch: 0.1.12
worked.
Now the layout seems... strange; but I'll look for what that could be and back if I cannot resolve.
For now, I appreciate your help.
Sorry, but I still having the same issue when I tried to build the project.
Running ng serve
everything works fine; but if I run ng build --env=prod --aot
I got:
ERROR in Unexpected value 'SwitchComponent in /.../node_modules/angular2-bootstrap-switch/lib/switch.component.d.ts' declared by the module 'AppModule in /.../src/app/components/index.ts'. Please add a @Pipe/@Directive/@Component annotation.
My bad, running ng build --env=prod
worked.
Yea I saw this was happening, maybe is the same issue as here #10 I think it's an issue provoked by the angular version I used to create the project the first time, which was Angular 2. Using version 4> has this compatibility issues.
if running ng build --env=prod
works OK and produce the same build, I think that's a good workaround.
I'm getting:
app.module
Using:
Angular: 4.2.0 Angular CLI: 1.0.6 angular2-bootstrap-switch: 0.1.9