If you are using ES6 Classes and ControllerAs
syntax, you need to do something slightly different.
See the snippet below and note that vm
is the ControllerAs
value of the parent Controller as used in the parent HTML
myApp.directive('name', function() {
return {
// no scope definition
link : function(scope, element, attrs, ngModel) {
scope.vm.func(...)