Skip to content

Instantly share code, notes, and snippets.

Created May 28, 2015 18:18
What would you like to do?
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>'
controller: 'DemoDirectiveController',
controllerAs: 'vm',
bindToController: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment