title: Error : No providers for Component
body: <p>I have a directive where I defined a radio button and I want to call a method of a component ..
  Whene I inject the component in constructor I got this error : <code>ERROR Error: No provider for FoldersComponent!
  </code></p>
  
  <p><strong>directive.ts</strong></p>
  
  <pre><code>   import { FoldersComponent } from '../folders/folders.component';
  import { Directive, ElementRef, HostListener, Input, AfterViewInit, ViewChild, EventEmitter, Output } from '@angular/core';
  
  declare var jQuery: any;
  
  @Directive({
    selector: '[icheck]'
  })
  
  export class IcheckDirective implements AfterViewInit {
  
    @Output('icheck')
    callComponentFunction: EventEmitter&lt;any&gt; = new EventEmitter&lt;any&gt;();
    constructor(private el: ElementRef, private parentCmp: FoldersComponent) {
      jQuery(this.el.nativeElement).iCheck({
        checkboxClass: 'icheckbox_square-aero',
        radioClass: 'iradio_square-aero'
      }).on('ifChecked', function(event) {
        if (jQuery('input').attr('type') === 'radio') {
          this.parentCmp.selectType();
        }
      });
    }
  
    ngAfterViewInit(): void {
    }
  }
  </code></pre>
  
  <p>folder.component.ts</p>
  
  <pre><code>@Component({
    selector: 'app-folders',
    templateUrl: './folders.component.html',
    styleUrls: ['./folders.component.css'],
  })
  export class FoldersComponent implements OnInit {
     constructor(
      private route: ActivatedRoute,
      private router: Router
    ) {  }
  
    selectType() {
      //    alert();
      console.log("Ici");
    }
  }
  </code></pre>
  
  <p>folder.component.html</p>
  
  <pre><code>&lt;input type="radio" icheck name="filters.type" [(ngModel)]="filters.type"                   value="IN"&gt; (IN)
  </code></pre>
  
  <p>My @NgModule</p>
  
  <pre><code>@NgModule({
    declarations: [
      AppComponent,
      LoginComponent,
      FoldersComponent,
    ],
  </code></pre>