title: Unit test failing. Failed: StaticInjectorError(DynamicTestModule)[HomeComponent -> NgbModal]:
body: <p>My home spec is:</p>
  
  <pre><code>fdescribe('HomeComponent', () =&gt; {
    let component: HomeComponent;
    let fixture: ComponentFixture&lt;HomeComponent&gt;;
    let service: HomeService;
  
    beforeEach(async(() =&gt; {
      TestBed.configureTestingModule({
        schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA],
        providers: [
          {provide: HomeService, useClass: HomeServiceStub}
        ],
        declarations: [HomeComponent]
      }).compileComponents();
    }));
    beforeEach(async(() =&gt; {
      fixture = TestBed.createComponent(HomeComponent);
      component = fixture.componentInstance;
      fixture.detectChanges();
      service = TestBed.get(HomeService);
    }));
    fit('should create', () =&gt; {
      expect(component).toBeTruthy();
    });
    it('should call get user details from homeService onInit', () =&gt; {
      spyOn(service, 'getUserDetails').and.callThrough();
      component.ngOnInit();
      expect(service.getUserDetails).toHaveBeenCalled();
    });
    it('should dataplan submission page on dataplan submission click ', () =&gt; {
      spyOn(service, 'onDataPlanCall').and.callThrough();
      component.dataPlanSubmission();
      expect(service.onDataPlanCall).toHaveBeenCalled();
    });
  });
  </code></pre>
  
  <p>My component is:</p>
  
  <pre><code>import {
    Component,
    OnInit
  } from '@angular/core';
  import {HomeService} from '../../shared/home/home.service';
  import {Router} from '@angular/router';
  import {NgbModal} from '@ng-bootstrap/ng-bootstrap';
  import {UploadComponent} from '../upload/upload.component'
  
  
  @Component({
    selector: 'home',  // &lt;home&gt;&lt;/home&gt;
    providers: [
    ],
    styleUrls: [ './home.component.scss' ],
    templateUrl: './home.component.html'
  })
  export class HomeComponent implements OnInit {
  
  
    constructor(private homeService: HomeService, private _ngbModal: NgbModal) {
    }
  
    public ngOnInit() {
      this.homeService.getUserDetails();
    }
  
    toggleUploadModal() {
      this._ngbModal.open(UploadComponent, {size: 'lg'})
    }
  
    dataPlanSubmission() {
      this.homeService.onDataPlanCall();
    }
  }
  </code></pre>
  
  <p>The error I get when testing is:</p>
  
  <pre><code>PhantomJS 2.1.1 (Windows 7 0.0.0) HomeComponent should create FAILED
          Failed: StaticInjectorError(DynamicTestModule)[HomeComponent -&gt; NgbModal]:
            StaticInjectorError(Platform: core)[HomeComponent -&gt; NgbModal]:
              NullInjectorError: No provider for NgbModal!
  </code></pre>