Skip to content

Instantly share code, notes, and snippets.

@adamweeks
Created May 28, 2015 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamweeks/8f58837d0d11caafc477 to your computer and use it in GitHub Desktop.
Save adamweeks/8f58837d0d11caafc477 to your computer and use it in GitHub Desktop.
function DemoDirective(){
return {
restrict: 'E',
scope: {
stringBind: '@',
objectBind: '=',
functionBind: '&'
},
template: [
'<p>Hello, {{vm.stringBind}}! Please order donuts:</p>',
'<p>Quantity: <input ng-model="vm.objectBind"></p>',
'<p><button ng-click="vm.functionBind()">Order Donuts!</button>'
].join(''),
controller: 'DemoDirectiveController',
controllerAs: 'vm',
bindToController: true
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment