Friday 15 June 2012

javascript - Manually change state with ui-router in angular -



javascript - Manually change state with ui-router in angular -

i have search bar in app. anytime user makes search, i'd state alter /#/search/:query

to so, attach next function scope , trigger anytime query made:

this.searchitem = function searchitem(item) { $state.go('#/search/' + item) }

however results in next error:

error: couldn't resolve '#/search/query' state (current state) @ object.transition.to

what problem code? how can alter state without using anchors ui-router?

many thanks

you're passing url when need pass name of state. see ui-router wiki examples.

javascript angularjs angular-ui-router

No comments:

Post a Comment