Slide 6
Slide 6 text
Directive ጱᳯ᷌
module.directive('fooBar', function () {
return {
scope: {
data: '='
},
template: '{{ ctrl.foo }} {{ ctrl.data.xx }}',
controllerAs: 'ctrl',
controller: function ($scope) {
this.foo = 'this is foobar directive'
// handle data
var self = this
$scope.$watch('data', function (data) {
self.data = data
})
}
}
})
2015.7 6