$routeProvider
(service in module ui.router.compat
)
$routeProvider
of the ui.router.compat
module overwrites the existing
routeProvider
from the core. This is done to provide compatibility between
the UI Router and the core router.
It also provides a when()
method to register routes that map to certain urls.
Behind the scenes it actually delegates either to
$urlRouterProvider or to the
$stateProvider to postprocess the given
router definition object.
Registers a route with a given route definition object. The route definition object has the same interface the angular core route definition object has.
url – {string} –
URL as string
route – {object} –
Route definition object
{object}
– $routeProvider - $routeProvider instance
var app = angular.module('app', ['ui.router.compat']); app.config(function ($routeProvider) { $routeProvider.when('home', { controller: function () { ... }, templateUrl: 'path/to/template' }); });