Skip to content

Instantly share code, notes, and snippets.

@okiroth
Created August 24, 2016 18:33
Show Gist options
  • Select an option

  • Save okiroth/8a1c4a6a8f35dbff5916fa9976260e33 to your computer and use it in GitHub Desktop.

Select an option

Save okiroth/8a1c4a6a8f35dbff5916fa9976260e33 to your computer and use it in GitHub Desktop.
export default class ExampleDirective {
constructor() {
this.template = '<div>{{ctrl.name}}</div>';
this.restrict = 'E';
this.scope = {};
this.controller = ExampleDirectiveController;
this.controllerAs = 'ctrl';
this.bindToController = true;
}
// Directive compile function
compile() {
}
// Directive link function
link() {
}
}
// Directive's controller
class ExampleDirectiveController {
constructor () {
this.name = 'david';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment