Question

I'm a beginner in Web Development and in AngularJS framework and I have a design question.

I have a 'SearchCtrl' controller and a 'Search' function in it. 'Search' gets a search results from REST service.

Now, 'Search' function is invoked by pressing the button in View and the URL doesn't change after it. So, if I will do the search by passing parameters throw URL it wouldn't work.

What is the best way to invoke 'Search' in both ways - from View and from URL?

Thank you!

Was it helpful?

Solution

Use ngView to get data from url http://docs.angularjs.org/api/ngRoute.directive:ngView

and $location to change url when search button is pressed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top