0
我在使用AngularJS的另一個指令內有一個指令。名稱({{questions.n3A.name}})未被顯示。標題沒有顯示在AngularJS(指令中的指令)
這裏是我的JS:
.directive('myRating', function() {
return{
restrict: 'E',
template: '<div><div class="row question">{{questions.n3A.name}}</div> \
<div class="row rating" ng-controller="RatingDemoCtrl"> \
<rating value="rate" max="max" readonly="isReadonly" state-on="\'glyphicon-star rated\'" state-off="\'glyphicon-star\'"></rating> \
<div class="col-md-12"> \
<button class="btn btn-sm btn-danger form-control" ng-click="rate = 0" ng-disabled="isReadonly">Clear</button> \
</div> \
</div> \
</div>',
replace: true,
scope: {
text: '@'
}
};
});
$scope.questions = {
"n3A": {
"name": "How safe did you feel on your trip?",
"ID": "n3A"
},
"n3B": {
"name": "How did you get there?",
"ID": "n3B"
},
};我也做了一個Pluncker。點擊是和南美洲/亞洲/非洲時,標題應顯示在星星之上。
有什麼想法我錯過了什麼?