I have an AngularJS app that contains multiple sets of data, created from nested ng-repeat directives. I'd like to be able to alter the state of all of these items using a navigation bar - i.e. to change a variable to see 'this week', 'last week' etc.
The current directives I have each take a variable to filter the data to the correct time frame. However I am stuck at creating a variable that can be used by these nested items and then how to update that variable.
I know that global variables should be avoided - can anybody help in terms of how I should do this correctly?
Thanks