I have created the text input field as component. Now i am using the 
component in a form multiple times. I want to apply a directive only to 
some fields not all. I want to pass the directive name as the @input to 
component and pass it to component html template as attribute dynamically.

Psuedo code


   1. <form> 
   2.  
   3.     <text-input-comp [directiveName]="mydirective" ></text-input-comp>
   4.     <text-input-comp></text-input-comp>
   5.     <text-input-comp></text-input-comp>
   6.  
   7. </form>

the template code of <text-input-comp></text-input-comp> is look like this 
<input type="text" placeholder="fieldname"> and 

I want to it should look like <input type="text" placeholder="fieldname" 
 mydirective>. The attribute "mydirective" should be pass to component as 
@Input() directiveName

Any help will be appreciated. Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to