title: Add directive from directive
body: <p>I have a directive deciding if an input must be required, masked, etc... I ran into a situation that I need to add a new directive to it: basically this new directive adds the mask feature to the input.</p>
  
  <pre><code>&lt;input type="text" formInput [rules]="rules"  [(ngModel)]="value" /&gt;
  </code></pre>
  
  <p>This is the formInput directive:</p>
  
  <pre><code>export class DefaultFormInputDirective {
  
  @Input() private rules;
  private el: ElementRef;
  
  constructor(el: ElementRef) {
      this.el = el;
  }
  
  ngOnInit() {
      this.defineRules();
  }
  
  defineRules() {
  
      if(this.rules == undefined) {
          return;
      }
  
      if(this.rules.indexOf('required') != -1) {
          this.el.nativeElement.required = true;
      }
  
      if(this.rules.indexOf('numeric') != -1) {
          // Here is where I need to add currencyMask directive
      }
  
  }
  
  }
  </code></pre>
  
  <p>This is the package I am using: <a href="https://www.npmjs.com/package/ng2-currency-mask" rel="nofollow noreferrer">https://www.npmjs.com/package/ng2-currency-mask</a></p>