我有从互联网上找到的代码:
如何在控制器中使用它,ng-repeat
除了这个指令?
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
module = angular.module('treeGrid', []);
module.directive('treeGrid', [
'$timeout', function ($timeout) {
return {
restrict: 'E',
//templateUrl:'tree-grid-template.html',
template: "<div class=\"row\"> " +
"<div class=\"row\">" +
"<table class=\"table table-bordered table-striped tree-grid\">" +
"<thead class=\"text-primary\">" +
"<th ></th>" +
"<th >سطح</th>" +
"<th>وزن</th>" +
"<th >هدف</th>" +
"<th>امتیاز</th>" +
"<th>درصد تحقق</th>" +
"<th>توضیحات</th>" +
"</thead>" +
"<tbody>" +
"<tr ng-repeat=\"row in tree_rows | filter:{visible:true} track by row.branch.uid\" ng-class=\"'level-' + {{ row.level }} + (row.branch.selected ? ' active':'')\" class=\"tree-grid-row\" >" +
"<td style=\"width:85px\" class=\"text-primary\">" +
"<a ng-click=\"user_clicks_branch(row.branch)\">" +
"<i ng-class=\"row.tree_icon\" ng-click=\"row.branch.expanded = !row.branch.expanded\" class=\"indented tree-icon\">" +
"</i>" +
"</a>" +
"<span class=\"indented tree-label\" >" +
"{{row.branch[expandingProperty]}}" +
"</span>" +
"</td>" +
"<td " +
"<label >" + "<label >" +
"خود ارزیابی</label>" +"</br>"+
"تایید اولیه" +
"</label>" +
"<br/>" +
"<label >" +
"تایید نهایی</label>" +"</br>"+
"</td>" +
"<td > "+
" <label type=text >1</label> " +
"<br/> " +
" <label type=text >2</label>" +
"<br/> " +
" <label type=text >3</label>" +
"</td> " +
" <td > " +
" <label type=text >4</label> " +
" <br/> " +
" <label type=text >5</label>" +
" <br/> " +
" <label type=text >6</label>" +
"</td> " +
" <td ><label type=text >7</label> " +
" <br/> " +
" <label type=text >8</label>" +
" <br/> " +
" <label type=text >9</label>" +
"</td> " +
"<td > <label type=text>10</label> <br/> " +
" <label type=text >11</label>" +
" <br/> " +
" <label type=text >12</label>" +
"</td>" +
"<td >" +
"<label type=text >13</label> " +
" <br/> " +
" <label type=text >14</label>" +
" <br/> " +
" <label type=text >15</label>" +
"</td>" +
"</tr>" +
"</tbody></table></div></div>",
replace: true,
scope: {
treeData: '=',
colDefs: '=',
colDefs2: '=',
expandOn: '=',
onSelect: '&',
initialSelection: '@',
treeControl: '=',
////////88888888888888
Weight: '=',
Goal: '=',
Operation: '=',
Score: '=',
PRealization: '=',
Description:'='
},
...
}).call(this);