Utilizing ui router ($routeprovider and $locationprovider) for angular js, I am looking to adjust the array being looped through in an ng-repeat based on the current url/route. Despite browsing similar threads on stack, I have not found a precise solution to my issue.
The following are my routes:
.when('/limited', {
template: '<di-home></di-home>',
activeTab: 'home',
caseInsensitiveMatch: true,
})
.when('/all', {
template: '<di-home></di-home>',
activeTab: 'home',
caseInsensitiveMatch: true,
})
When the URL changes, I aim to switch the ng-repeat statement from "things in Ctrl.data.all" to "things in Ctrl.data.limited" using some form of conditional logic.
<md-card class="md-whiteframe-4dp" ng-repeat="things in Ctrl.data.all" flex-xs="100" flex-sm="100" flex-md="45" flex-gt-md="30"></md-card>
What approach would be most effective for achieving this? Any guidance or reference to a relevant post would be greatly appreciated! Thanks!