0
.directive('phoneType', [function() {
return {
scope: {
phoneNumber: '=phoneType'
}
link: function (scope, element, attrs) {
// now do stuff with the number, you can access it through the scope
scope.phoneNumber // contains the number
scope.vm.somethingInMyController // vm is undefined
}
};
}])
Как достичь обоего phoneType
и vm
переменных в моей директиве?Угловой: Как получить родитель и объем элемента в директиве
Попробуйте console.log сферу. $ Родительским. –