Hi David,
Try it like this:
angular.module('myPlunk', [])
.directive('pIcon', () => {
return {
bindToController: {
'iconType': '@',
'iconDefinition': '@'
},
controller: function () {
this.bla='test' // in an arrow function you have no access to
the 'this'!
},
controllerAs: '$ctrl'
templateUrl: 'components/icon/icon.html'
}
})
Your problem is probably an combination of the fact that you are using
arrow functions (that bind to the lexical this, and might be confusing in
constructs like you made. Also between versions there where some
differences between isolate scope, and bindtoController. IIRC the case now
is that if you use bindtoController you always get an isolate scope.
Regards
Sander
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.