0

var app = angular.module('TaskApp', []);

app.config(['$routeProvider', '$locationProvider', function ($routeProvider, $locationProvider) { $routeProvider.when('/Home', { templateUrl: '/Home/Index', controller: 'IndexController' }); $locationProvider.html5Mode(true); //$locationProvider.hashPrefix(''); }]); 

This code is not working properly ,When I remove $routeProvider all reference it work properly but I need $routeProvider how I solve it ?

2
  • 1
    your arguments are swapped Commented Oct 22, 2014 at 18:13
  • Thanks corn, I swapped argument but problem is still yet Commented Oct 22, 2014 at 18:16

1 Answer 1

3
 app.config(['$routeProvider', '$locationProvider', function ($locationProvider, $routeProvider) { 

Oops

EDIT

 var app = angular.module('TaskApp', ['ngRoute']); 

You also need to add the route service to the app.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks corn, I swapped argument but problem is still yet
@DineshPipple did adding the ngRoute help. you will also need to add it in the path for your scripts. Not sure what version of Angular you're using docs.angularjs.org/api/ngRoute/provider/$routeProvider
I add 'ngRoute' in my module and angular-route.min.js in my code route is working. Now new problem is arise I define it my new question stackoverflow.com/questions/26536054/… Please take a look give your suggestion

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.