가 나는 이 AngularJS 지시문은 한 번만 호출됩니까?
angular.module('MainCtrl', [])
.controller('MainController', function($scope) {
$scope.tagline = 'To the moon and back!';
})
.directive('mixitContainer', function() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
$(element).mixItUp(scope.$eval(attrs.mixitContainer));
}
};
});
, 그것은 단순히 테스트
메인 컨트롤러의 단순함에 대해 걱정하지 마십시오 입니다
나는에 대한 지시 모듈을 만들어 내 각 페이지의 내부와 그렇게하기 위해 mixitup 밀어하기 위해 노력하고있어 .이제 문제는 지시문이 한 번만 호출된다는 것입니다. 다른 페이지로 이동하여 각도를 요청하여 다른 컨트롤러를로드 한 다음 홈 페이지로 돌아가 각도가 MainCtrl을 다시로드하도록 요청하면 지시문이로드되지 않습니다!
을 Heres하여 지시문 :
<div id="Container" class="mixit-container" mixit-container="{load: {sort: 'order:asc'}, controls: {toggleFilterButtons: true, toggleLogic: 'and'}}">
누구나 어떤 아이디어를 가지고?
가능하면 피들 또는 그와 같은 옵션을 지정하십시오. – dotnetstep
@dotnetstep 시도 하겠지만 힘든 일 이겠지요. : –
""각도를 사용하여 MainCtrl을 다시로드 하시겠습니까? " –