From 0a6e464a93d9a1e76a624b356054ce9ca4015f55 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Thu, 17 May 2012 16:36:18 -0700 Subject: 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`. --- docs/content/cookbook/deeplinking.ngdoc | 4 +- docs/content/tutorial/step_07.ngdoc | 4 +- example/temp.html | 4 +- src/ng/directive/ngView.js | 4 +- src/ng/route.js | 27 ++++++---- test/ng/directive/ngViewSpec.js | 65 +++++++++++++++-------- test/ng/routeSpec.js | 91 ++++++++++++++++----------------- 7 files changed, 113 insertions(+), 86 deletions(-) diff --git a/docs/content/cookbook/deeplinking.ngdoc b/docs/content/cookbook/deeplinking.ngdoc index 491e3b79..1e9c0161 100644 --- a/docs/content/cookbook/deeplinking.ngdoc +++ b/docs/content/cookbook/deeplinking.ngdoc @@ -35,8 +35,8 @@ In this example we have a simple app which consist of two screens: angular.module('deepLinking', ['ngSanitize']) .config(function($routeProvider) { $routeProvider. - when("/welcome", {template:'welcome.html', controller:WelcomeCntl}). - when("/settings", {template:'settings.html', controller:SettingsCntl}); + when("/welcome", {templateUrl:'welcome.html', controller:WelcomeCntl}). + when("/settings", {templateUrl:'settings.html', controller:SettingsCntl}); }); AppCntl.$inject = ['$scope', '$route'] diff --git a/docs/content/tutorial/step_07.ngdoc b/docs/content/tutorial/step_07.ngdoc index f8b5cf52..f0812278 100644 --- a/docs/content/tutorial/step_07.ngdoc +++ b/docs/content/tutorial/step_07.ngdoc @@ -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'}); }]); diff --git a/example/temp.html b/example/temp.html index 22eb2de7..da92c68c 100644 --- a/example/temp.html +++ b/example/temp.html @@ -6,8 +6,8 @@