title: Angular2 - using 3rd parety module's component
body: <p>I created a module which has a directive in it (<code>ObDatePickerModule</code>).<br>
  Also I created a project which has <code>ObDatePickerModule</code> in it's dependencies (under dependencies in <code>package.json</code>).<br>
  Next I am importing Module A in my project's module:  </p>
  
  <pre><code>import {BrowserModule} from '@angular/platform-browser';
  import {NgModule} from '@angular/core';
  import {FormsModule} from '@angular/forms';
  import {ObDatePickerModule} from 'ng2-date-picker';
  
  import {AppComponent} from './app.component';
  
  @NgModule({
    declarations: [
      AppComponent
    ],
    imports: [
      BrowserModule,
      FormsModule,
      ObDatePickerModule,
    ],
    providers: [],
    bootstrap: [AppComponent]
  })
  export class AppModule {
  }
  </code></pre>
  
  <p>Here is the app.component of the project: </p>
  
  <pre><code>import {Component} from '@angular/core';
  import {ObDayPickerComponent} from 'ng2-date-picker';
  import * as moment from 'moment';
  
  @Component({
    selector: 'app-root',
    template: '&lt;ob-day-picker [(ngModel)]="date"&gt;&lt;/ob-day-picker&gt;',
    styleUrls: ['./app.component.css'],
    entryComponents: [ObDayPickerComponent]
  })
  export class AppComponent {
    date = moment();
  }
  </code></pre>
  
  <p>Here is the error that I am getting:  </p>
  
  <pre><code>main.bundle.js:66421 Unhandled Promise rejection: Template parse errors:
  'ob-day-picker' is not a known element:
  1. If 'ob-day-picker' is an Angular component, then verify that it is part of this module.
  2. If 'ob-day-picker' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. ("[ERROR -&gt;]&lt;ob-day-picker [(ngModel)]="date"&gt;&lt;/ob-day-picker&gt;
  </code></pre>
  
  <p>I checked that the component name is really <code>ob-day-picker</code>.  </p>
  
  <p>I have also consoled log both the module and the <code>ObDayPickerComponent</code> imports and it seems that the imports are correct.  </p>
  
  <p>What did I miss?</p>
  
  <p><strong>Checkout the module repo:</strong><br>
  <a href="https://bitbucket.org/vlio20/ng2-date-picker" rel="nofollow">https://bitbucket.org/vlio20/ng2-date-picker</a></p>
  
  <p><strong>The project can be found here:</strong><br>
  <a href="https://github.com/vlio20/3rd-ng2-module" rel="nofollow">https://github.com/vlio20/3rd-ng2-module</a></p>