Skip to content

Instantly share code, notes, and snippets.

@yngvebn
Created April 10, 2015 06:13
Show Gist options
  • Save yngvebn/d2c9a0326a7ea5f63a60 to your computer and use it in GitHub Desktop.
Save yngvebn/d2c9a0326a7ea5f63a60 to your computer and use it in GitHub Desktop.
function MyDirectiveController($scope){
var vm = this;
// bind in GUI
vm.value = $scope.ngModel.value;
}
function MyDirective(){
return {
templateUrl: '/my/template.html',
scope: {
ngModel = '='
},
controller: MyDirectiveController,
controllerAs: 'my'
}
}
angular.module('acme').directive('myDirective', MyDirective);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment