Link to home
Create AccountLog in
Avatar of ksd123
ksd123

asked on

Routing based on dropdown change in angularjs

Hi,

We are developing single page application using angularjs and our index page consists of 3 sections so we have separate pages/partial views  for these sections.My requirement is in the index page we will have dropdown with 3 options and based on option selected I have to show that section(page/html).So in the dropdwon on ng-change there is  a function that will pass selected value to controller and show respective page/view.I am injecting $location service into the controller and showing the respective page/view.But I came to know that using $location service  will redirect to sepearte html/page and will show different url in the address bar of a browser.

I want to show the page/html based on dropdown change without using $location service in the controller, I tried injecting $route into the controller but getting error.Can anyone correct me how to resolve this issue.Here is the plunker routing
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account