Wednesday 19 December 2018

javascript - Reloading state without refreshing ui-router

I'm using ui router, now I want to filter data using params in url (search part of url), without reloading state - I dont need to ask server everytime I want to find something in collection.



my idea is to listen event $routeChangeSuccess, take all search params and apply angular filter on collection with them.



I tried to do something like this



{{invoiceType.name}}


to change url for example to ?invoice_type_id=2 but without any success (state is reloading)...



then I wrote my own directive which listens $locationChangeStart and uses reloadOnSearch: false in state provider, but i feel like a rewriting ui-router functionality (reactions on loading page with some params set, highlighting active link etc...)



So I want to ask is it possible with ui-router? If is what am I doing wrong? Or is there a completely different approach how to do filtering?



Thanks Blazek

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...