Skip to content

Route provider legacy support

Jens Melgaard edited this page Jul 29, 2013 · 3 revisions

As stated under the basic configuration, the new $routeProvider ships with a legacy module that enables the old style routing and use of ng-view.

Simply load the ui.routing.legacy module as well

angular.module('phonecat', ['dotjem.routing', 'dotjem.routing.legacy']).
  config(['$routeProvider', function($routeProvider) {
  $routeProvider
      .when('/phones', {
          templateUrl: 'partials/phone-list.html',
          controller: PhoneListCtrl})
      .when('/phones/:phoneId', {
          templateUrl: 'partials/phone-detail.html',
          controller: PhoneDetailCtrl})
      .otherwise({redirectTo: '/phones'});
}]);

This should enable big existing web-applications to migrate a bit at a time.

Clone this wiki locally