Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am new in Angular js.I try to make html5 mode true in one of my controller .In my angular js app there is 3 controller but i need to html5 mode true in one of them not in all controller. I am using

App.config(function($locationProvider) {
  $locationProvider.html5Mode(true);     
});

But this config effect all of my controller.I need to add html5mode true under one of my controller.I don't know is it possible or not .

share|improve this question
    
its not possible, why do you want to do it for a controller btw? –  HarishR yesterday
    
In my site only 3 page used angular js controller .When i used config html5mode true the it just change the url not able load other page –  Himanshu yesterday
    
that would mean that the route change configuration is wrong, rather than fixing html5mode, i think you should try to fix the routing part. –  HarishR 14 hours ago

1 Answer 1

Providers are only available when instantiating an Angular module. You can only use providers for a module before it is instantiated inside a config block. So you can configure $locationProvider once per module and not at the controller level.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.