Skip to content

Instantly share code, notes, and snippets.

@icfantv
Created February 4, 2016 02:17
Show Gist options
  • Save icfantv/ff9adc2b8833a5482e6b to your computer and use it in GitHub Desktop.
Save icfantv/ff9adc2b8833a5482e6b to your computer and use it in GitHub Desktop.
ES6 modules, Angular Directives, and you
import angular from 'angular';
import {MyDirective} from './MyDirective';
const MODULE_NAME = 'my.directives';
export default MODULE_NAME;
angular.module(MODULE_NAME, [])
.directive('myDirective', MyDirective);
export function MyDirective() {
return {
restrict: 'E',
controller: 'MyDirectiveController',
controllerAs: 'snoopy',
scope: {
stuff: '=yoGimmeSomeStuff'
},
templateUrl: 'components/snoopy/views/gimme-some-stuff-template.html'
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment