사용자 지정 지시문을 사용하여 팝업을 트리거하는 단추가 있습니다. 문제는 버튼을 클릭 할 때 popover가 비어 있고, 사용자 정의 지시문은 각도 순환 (입력 필드의 데이터 변경 등)을 수행 할 때만 실행됩니다. 일단 popover가 예상대로 사용자 지정 지시문을 사용하여 다시 그립니다.Popover 다시 그리기의 AngularJS 사용자 지정 지시문
Popover가 열릴 때 사용자 지정 문이 실행되도록하려면 어떻게해야합니까?
일부 코드 :
버튼 - <button type="button" class="btn btn-primary btn-small" bs-popover="'partials/test.html'"><i class="icon-white icon-plus"></i></button>
파셜/test.html를 - <itemlist apicall="'attributes'" editable="'false'" selectable="'true'" viewtype="'attributes'" template="partials/itemlist.html"></itemlist>
(ITEMLIST 사용자 정의 지시어입니다)
ITEMLIST 지침 -
.directive('itemlist', function() {
return {
restrict: 'AE',
scope: { apicall: '=', editable: '=', viewtype: '=', selectable: '=' },
controller: function ($scope, $http, $resource, $timeout, fileReader, apiaddress, $dialog, errormsg) {
var resource = $resource(apiaddress + $scope.apicall, {}, { update: { method: 'PUT', params: { id: '@Id' } } });
$scope.apiresource = { list: resource.query() };
//TODO: See how to only display one.
toastr.info("Loading...");
},
templateUrl: function (tElement, tAttrs) { return tAttrs.template },
replace: true
};
})
한가지 더 - itemlist
맞춤 지정 문은 앱의 다른 영역에서 작동합니다.
감사합니다.
감사합니다. 나는 그것을 시도했지만 그렇지 않습니다. 결코 멀리 가지 않습니다.'partials/test.html' 안에있는 전체 itemlist 지시어는 다른 각도 순환이 강제 될 때까지 처리되지 않습니다. – americanslon