Skip to content

Instantly share code, notes, and snippets.

@palcisto
Created February 25, 2016 17:23
Show Gist options
  • Save palcisto/7a3fc2ac1fcecbd5c305 to your computer and use it in GitHub Desktop.
Save palcisto/7a3fc2ac1fcecbd5c305 to your computer and use it in GitHub Desktop.
Angular Directive Boilerplate
(function() {
'use strict';
angular
.module('', [])
.directive('xxDirectiveName', xxDirectiveName)
.controller('DirectiveNameController', DirectiveNameController);
xxDirectiveName.$inject = [];
function xxDirectiveName(argument) {
return {
restrict: 'EA',
scope: {},
controller: 'DirectiveNameController',
controllerAs: 'vm',
bindToController: {
name: '='
}
templateUrl: 'templatePath.html',
link: function($scope) {}
};
}
function DirectiveNameController(argument) {
const vm = this;
activate();
function activate() {
// body...
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment