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.
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!
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.