ovsleep / bootstrap-switch

This is a Angular 2 Component to add a switch like input.
https://bootstrap-switch.herokuapp.com/
8 stars 10 forks source link

Cannot read property 'toString' of undefined #5

Closed alienriquebm closed 7 years ago

alienriquebm commented 7 years ago

Hi my friend, i start to use this on my proyect and it gives me this error:

Cannot read property 'toString' of undefined

Here is my code:

<switch class="form-control" [status]="value" [onText]="'Si'" [offText]="'No'" [onColor]="'green'" [offColor]="'gray'" [size]="'small'"></switch>

I already import your component on my module:

import { NgModule } from '@angular/core';
import { SwitchComponent } from 'angular2-bootstrap-switch/components';

@NgModule({
    imports: [
        SharedModule,
    ],
    exports: [],
    declarations: [
        SwitchComponent
        ],
    providers: [CalendarProviderService, CalendarGuard],
})
export class CalendarModuleModule { }

image

Can you help me?

alienriquebm commented 7 years ago

Nevermind. I forget to add the "value" var on my component class...