Custom directives


  • Custom attribute directive 
  • Listening host events using @HostListerner(..) 
  • Parameterizing custom attribute directive using @Input() 
  • How structural directive gets converted internally 
  • Custom structural directive

Custom Attribute Directive

What we want do with a custom directive 

  • Create a custom directive called bg-highlight 
    • When applied, it will highlight the element's background with designated color 
  • This directive will be used as an attribute to an element 
    •  < div bg-highlight >This content will be highlighted </ div >

You must have an active subscription to download PDF and Lab Zip of this course topic.Please click the "Subscribe" button or the "Login" button if you already have an account.