http://stackoverflow.com/questions/17514272/filtering-an-ng-repeat-list-based-on-a-sub-object-property
you are allowed to create new scope members inside the expressions.
filterdGoals1 and filterdGoals2 executed before it is being used
<div class="cfaesProfile_box"> <div ng-repeat="goal in filterdGoals1 = (source.goals | filter: {goal_type:'1'} | filter:{goal_year:year.value})"></div> <div ng-repeat="goal in filterdGoals2 = (source.goals | filter: {goal_type:'2'} | filter:{goal_year:year.value})"></div> len={{filterdGoals.length}} <div ng-show="filterdGoals1.length">Performance</div> <div ng-if="year.value == goal.goal_year && !year.collapsed" ng-repeat="goal in filterdGoals1"> <div class="publist box-pop"> <div class="cfaesProfile_row"> <div ng-click="editGoal($index)" class="cfaesProfile_option cfaesProfile_control fa fa-pencil"></div> <div class="cfaesProfile_option cfaesProfile_control fa fa-files-o"></div> <div class="cfaesProfile_option cfaesProfile_control fa fa-trash-o"></div> <div ng-click="goal.locked = !goal.locked" ng-class="goal.locked ? 'fa-unlock' : 'fa-lock'" class="cfaesProfile_option cfaesProfile_control fa"></div> <div class="cfaesProfile_label"> <div ng-class-odd="depth_1" ng-class-odd="depth_1_alt"> <span class="label_element goal-title">{{goal.goal_no}}. {{goal.goal_content}}</span></br> <span class="label_element goal-title">{{goal.goal_progress}}</span> </div> </div> </div> </div> </div> <div ng-show="filterdGoals2.length">Professonal Development</div> <div ng-if="year.value == goal.goal_year && !year.collapsed" ng-repeat="goal in filterdGoals2"> <div class="publist box-pop"> <div class="cfaesProfile_row"> <div ng-click="editGoal($index)" class="cfaesProfile_option cfaesProfile_control fa fa-pencil"></div> <div class="cfaesProfile_option cfaesProfile_control fa fa-files-o"></div> <div class="cfaesProfile_option cfaesProfile_control fa fa-trash-o"></div> <div ng-click="goal.locked = !goal.locked" ng-class="goal.locked ? 'fa-unlock' : 'fa-lock'" class="cfaesProfile_option cfaesProfile_control fa"></div> <div class="cfaesProfile_label"> <div ng-class-odd="depth_1" ng-class-odd="depth_1_alt"> <span class="label_element goal-title">{{goal.goal_no}}. {{goal.goal_content}}</span></br> <span class="label_element goal-title">{{goal.goal_progress}}</span> </div> </div> </div> </div> </div> </div>
No comments:
Post a Comment