这就是我想要做的:
<div class="row-fluid" ng-repeat="subtopic in topic.Subtopics">
<div class="row_divider"></div>
<div class="row_padding">
<span class="subtopic_level">{{subtopic.Name}}</span>
</div>
<div class="row-fluid" ng-repeat="subsubtopic in subtopic.Subsubtopics">
<div class="row_divider" ng-hide="subsubtopic.Name = subtopic.Name"></div>
<div class="row_padding" ng-hide="subsubtopic.Name = subtopic.Name">
<span class="subsubtopic_level">{{subsubtopic.Name}}</span>
</div>
<div ng-class="row-fluid: true, flat: flatTopicBranch(subsubtopic.Name=subtopic.Name)" ng-repeat="lesson in subsubtopic.Lessons">
<div class="row_divider"></div>
<div class="row_padding">
<span class="lesson_level">{{lesson.Name}}</span>
</div>
</div>
</div>
</div>
这是我的控制器中的功能:
controllers.controller('YourSigmaCtrl', function ($scope, $http) {
...
$scope.flatTopicBranch = function (subsubtopic, subtopic) {
return subsubtopic === subtopic;
};
...
它在 html 中显示不变。不受影响。未受影响。有任何想法吗??flatTopicBranch 是一个问题,因为我在调用它时更深入地了解它吗?
谢谢!