yuyang041060120 / angular2-ui-switch

angular2 ui switch component
http://yuyang041060120.github.io/angular2-ui-switch
MIT License
57 stars 36 forks source link

Unit tests: Can't bind to 'ngModel' since it isn't a known property of 'ui-switch' #15

Closed lewtur closed 7 years ago

lewtur commented 7 years ago

I've managed to use the module successfully, but now i'm trying to make it pass our unit tests, and it fails with the error Can't bind to 'ngModel' since it isn't a known property of 'ui-switch'.

Here is my test component

import { UiSwitchModule } from 'angular2-ui-switch';

describe('HubPreviewComponent', () => {
  let component: HubPreviewComponent;
  let fixture: ComponentFixture<HubPreviewComponent>;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [HubPreviewComponent, OfferPreviewComponent],
      imports: [ReactiveFormsModule, UiSwitchModule],
      providers: [ ... ]
    }).compileComponents();
  }));

I've also tried using import { UiSwitchModule } from '../../../node_modules/angular2-ui-switch/src'; as a previous post suggested.