Friday, 26 October 2018

angular6 how to make a directive


first use command:  ng generate directive [name] to generate the code

to control and change style:
to call hoster's function from directive:https://hackernoon.com/custom-directives-in-angular-6-building-a-google-places-autocomplete-4b418ee674ce


listen to host events
@HostListener('click') pageClicked () {
  xxxxx
}
https://alligator.io/angular/hostbinding-hostlistener/

No comments:

Post a comment