6
어떻게 다음과 같은 속성으로 전달 된 필드와 함께 각 범위를 사용자 정의 필드를 추가 할 수 있습니다AngularJS와 사용자 정의 지시 고립 범위 사용자 정의 필드
angular.module('app')
.directive("myDirective", function(){
function NewObj()
{
this.id = 0;
this.name = "";
}
return{
restrict: "E",
templateUrl:"partials/directives/temp.html",
scope:{
viewId:"=",
dataObj: new NewObj() //This is the custom obj
}
}
}
내가 그래서, 내가 잘못된 고립 범위를 얻을 않는 경우 정의. 어떻게이 작업을 수행 할 수 있습니까?
: 당신은 뭔가를 시도 할 수 있습니다, 당신이 원하는 것을 할 수 http://umur.io/angularjs-directives-using-isolated-scope-with-attributes/ –