Routing example not working

33 views
Skip to first unread message

gaurav...@googlemail.com

unread,
Sep 12, 2014, 6:35:22 AM9/12/14
to tot...@googlegroups.com
Hi Peter,

I need help running the angularjs-routing example.

https://github.com/totaljs/examples/blob/master/angularjs-routing"

No matter which URL I give, It always shows me the app.html.

Also when I tried to put in some debug statements by adding console.log in app.js to see if the correct block is getting invoked, I don;t see anything getting printed.

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

console.log("over here 1");
app.config(function($routeProvider, $locationProvider) {


console.log("over here 1");
$locationProvider.html5Mode(true);

$routeProvider.when('/', {
templateUrl: '/views/home.html',
controller: 'HomeCtrl'
}).when('/users/', {
console.log("over here");
templateUrl: '/views/users.html',
controller: 'UsersCtrl'
}).when('/products/', {
templateUrl: '/views/products.html',
controller: 'ProductsCtrl'
}).otherwise({ redirectTo: '/' });

});

Thanks & Regards
Shashi

Peter Širka

unread,
Sep 12, 2014, 3:39:19 PM9/12/14
to tot...@googlegroups.com, gaurav...@googlemail.com
Hi Sashi,
can you send my full example on my e-mail? I'll look into it.

Many thanks.
Reply all
Reply to author
Forward
0 new messages