Skip to content

Instantly share code, notes, and snippets.

@shadowmaru
Created June 19, 2015 14:45
Show Gist options
  • Save shadowmaru/9e48652352de8824a6be to your computer and use it in GitHub Desktop.
Save shadowmaru/9e48652352de8824a6be to your computer and use it in GitHub Desktop.
'use strict';
angular.module('app')
.directive('my-input', [
function() {
return {
restrict: 'E',
templateUrl: '/my-input.html',
scope: {},
controllerAs: 'myInput',
controller: [
'$scope',
function($scope) {
var self = this;
self.init = function() {
};
}
],
bindToController: true,
require: ['myInput'],
link: function(scope, iElement, iAttrs, controllers) {
var myInput = controllers[0];
myInput.init();
}
};
}
])
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment