Created
September 11, 2015 00:35
-
-
Save BryanWilhite/0b0484102980acf5ccb2 to your computer and use it in GitHub Desktop.
Using ngClass, $parent, $first and the Client View Model with ngRepeat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
isIndexSubsetHeaderSelected: function (subset, isFirst) { | |
if (!this.routeIndexSet) { | |
return false; | |
} | |
if (!this.routeIndexSubset) { | |
return isFirst; | |
}; | |
return (this.routeIndexSubset === subset); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div data-ng-if="!clientVM.isSplash" class="col-md-4 col-sm-4 col-xs-10 IndexSubset"> | |
<h3 data-ng-class="{selected:$parent.clientVM.isIndexSubsetHeaderSelected(i.id, $first)}" data-ng-repeat="i in clientVM.currrentIndexMeta"> | |
<a | |
href="{{i.url}}" | |
data-ng-if="i.url">{{i.text}}</a> | |
<a | |
href="#/index/{{$parent.clientVM.routeIndexSet}}/{{i.id}}" | |
data-ng-if="!i.url">{{i.text}}</a> | |
</h3> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment