0
나는 angularjs를 처음 사용하고 지침을 작성하려고합니다. 지침에 대한 나의 코드는Angularjs : 지시어에 ng-repeat 추가
Directives.directive("roleTemplate", function(){
return {
restrict : 'EA',
template : '<div class="box span6">'+
'<div class="box-header">'+
'<h2 class="custom"><i class="fa-icon-group" style="opacity:.7"></i><span class="break"></span>titile</h2>'+
'</div>'+
'<div class="box-content">'+
'<p><strong>As a team leader you are likely to...</strong></p>'+
'<ul>'+
'<li>test</li>'+
'</ul>'+
'</div>'+
'</div>',
replace : true,
link : function(scope,element,attr){
}
};
});
하고 난
<div role-template></div>
를 추가하지만 때 그것을 잘 작동 내가
<div class="box span6" ng-repeat = "ob in atWorkObjectsArray">
Firfox 메시지 팝업 말
이되는 템플릿 코드에 NG 반복을 추가 할 때A script on this page may be busy, or it may have stopped responding. You can stop the script now, open the script in the debugger, or let the script continue.
Script: http://localhost:8080/tm-webapp/resources/lib/angular.js:4678
내 질문은 이것이 ng-repeat에서 문제가 될 수 있습니까? 템플릿에서 사용할 수 있을까요?
UPDATA :
$scope.atWorkObjectsArray = [$scope.workEffectivenessObj,$scope.workTeamLeadObj];
WHERE
$scope.workEffectivenessObj = {"title":"Effectiveness", "array":userProperties.atWorkProblmSolving};
및
$scope.workTeamLeadObj = {"title":"Team Lead", "array":userProperties.atWorkTeamLead};
atWorkProblmSolving
atWorkTeamLead
는 자바 스크립트 배열입니다.
그리고보기 (html)에서 동일한 템플릿 코드를 사용하면 정상적으로 작동합니다.
내가이 질문에 더 많은 세부 사항을 추가 한 당신은 그것을하시기 바랍니다 볼 싶습니다. – Shahzeb
데이터 구조에 문제가있는 것처럼 보입니다. 예를 들어, 구조체가 어떻게 든 순환한다면 문제가있을 수 있습니다. atWorkObjectsArray를 [1,2]와 같은 몇 가지 알려진 것으로 바꾸면 작동합니까? 그렇다면 데이터가 유효한지 확인해야합니다. – hassassin