title: How to inject a parent component into a shared directive without specifying component type?
body: <p>How can I define my directive for use it in all component :</p>
  
  <p><strong>my directive.ts :</strong></p>
  
  <pre><code>import { Parent } from '../../_common/Parent';
  declare var jQuery: any;
  
  @Directive({
    selector: '[icheck]'
  })
  
  export class IcheckDirective implements AfterViewInit {
  
    constructor(private el: ElementRef, private parentCmp: Parent) {
      jQuery(this.el.nativeElement).iCheck({
        checkboxClass: 'icheckbox_square-aero',
        radioClass: 'iradio_square-aero'
      }).on('ifChecked', function(event) {
        if (jQuery('input').attr('type') === 'radio') {
          parentCmp.selectType(jQuery('input[name="filters.type"]:checked').val());
        }
      });
    }
  }
  </code></pre>
  
  <p><strong>my Parent.ts</strong></p>
  
  <pre><code>export abstract class Parent {
   }
  </code></pre>
  
  <p><strong>My component.ts (using icheck)</strong></p>
  
  <pre><code> import { Component, OnInit, ViewContainerRef } from '@angular/core';
      import { ActivatedRoute, Router } from '@angular/router';
      import { Parent } from '../../_common/Parent';
  
      declare var jQuery: any;
  
      @Component({
        selector: 'app-folders',
        templateUrl: './folders.component.html',
         providers: [{ provide: Parent, useExisting: AdminEditComponent }]
      })
      export class FoldersComponent implements OnInit, Parent {
  
           name = 'FoldersComponent ';
  
        constructor(
          private route: ActivatedRoute,
          private router: Router,
        ) {
        }
  
        ngOnInit() {
  
        }
  
        selectType(value: string) {
           console.log(value);
        }
      }
  </code></pre>
  
  <p><strong>my component.html :</strong></p>
  
  <pre><code>&lt;input type="radio" icheck checked&gt; =&gt; here how can I define an event for calling method **selectType** ?
  </code></pre>
  
  <p>Here, we can see that I use the component in param FoldersComponent, so when I want to use this directive (icheck) in other component (like AppComponent), I got error .. 
  How can I do for make it global for all component ..
  NB : In folderComponent I define method <strong>selectType</strong> called when I select a button radio </p>