Created
February 4, 2016 02:17
-
-
Save icfantv/ff9adc2b8833a5482e6b to your computer and use it in GitHub Desktop.
ES6 modules, Angular Directives, and you
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import angular from 'angular'; | |
import {MyDirective} from './MyDirective'; | |
const MODULE_NAME = 'my.directives'; | |
export default MODULE_NAME; | |
angular.module(MODULE_NAME, []) | |
.directive('myDirective', MyDirective); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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