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 범위를보십시오. $ 부모. –