Home:ALL Converter>Data filtering with uiRouter best practice

Data filtering with uiRouter best practice

Ask Time:2016-04-30T00:22:49         Author:splattru

Json Formatter

I have an Angular application with uiRouter and some data that I want to display using Angular-Chart.js.

I have different filters that can be applied to this data. I also want to have a URL that represents the state with all applied filters, i.e. /:groupId/:dateStart/:dateEnd

Right now I have a state with parameters, and two views (controller+template) - one for displaying data and one for displaying filters. In the filterController, I have a function that is called when the filter is changed, and that function simply calls $state.go("Controller", newFilterParams);

That approach works, however, that fully reloads the controller for the data, and I want to prevent it and animate the data change. But I also want to preserve the URL representation.

Is that possible? What would be the best practice to implement data filtering in Angular and uiRouter?

Author:splattru,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/36943237/data-filtering-with-uirouter-best-practice
yy