Routing example not working

33 vues
Accéder directement au premier message non lu

gaurav...@googlemail.com

non lue,
12 sept. 2014, 06:35:2212/09/2014
à 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

non lue,
12 sept. 2014, 15:39:1912/09/2014
à 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.
Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message