feat($route): rename template -> tempalteUrl and add support for inline templates

BREAKING CHANGE: template in $route definition is now templateUrl
To migrate just rename `template` to `templateUrl`.
This commit is contained in:
Misko Hevery
2012-05-17 16:36:18 -07:00
parent 7c24282188
commit 0a6e464a93
7 changed files with 113 additions and 86 deletions

View File

@@ -72,8 +72,8 @@ __`app/js/app.js`:__
angular.module('phonecat', []).
config(['$routeProvider', function($routeProvider) {
$routeProvider.
when('/phones', {template: 'partials/phone-list.html', controller: PhoneListCtrl}).
when('/phones/:phoneId', {template: 'partials/phone-detail.html', controller: PhoneDetailCtrl}).
when('/phones', {templateUrl: 'partials/phone-list.html', controller: PhoneListCtrl}).
when('/phones/:phoneId', {templateUrl: 'partials/phone-detail.html', controller: PhoneDetailCtrl}).
otherwise({redirectTo: '/phones'});
}]);
</pre>