私はangularjsが初めてで、ディレクティブを書き込もうとしています。ディレクティブの私のコードは
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>
しかし、テンプレートコードに ng-repeat を追加すると、
<div class="box span6" ng-repeat = "ob in atWorkObjectsArray">
というFifoxメッセージポップアップ
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 の問題でしょうか。テンプレートで使用できますか?
更新:
$scope.atWorkObjectsArray = [$scope.workEffectivenessObj,$scope.workTeamLeadObj];
どこ
$scope.workEffectivenessObj = {"title":"Effectiveness", "array":userProperties.atWorkProblmSolving};
と
$scope.workTeamLeadObj = {"title":"Team Lead", "array":userProperties.atWorkTeamLead};
atWorkProblmSolving
そしてatWorkTeamLead
JavaScript配列です。
ビュー(html)で同じテンプレートコードを使用すると、正常に動作します。