diff options
| author | Vojta Jina | 2011-07-12 02:18:46 +0200 |
|---|---|---|
| committer | Vojta Jina | 2011-09-08 23:00:59 +0200 |
| commit | 4421f3d43525437bd939f647604480c1ed126e5e (patch) | |
| tree | b27657098ccf4395827871533ba8bb2b5a90e7fc /docs/content | |
| parent | 22cb600280cecabf719ba1878719c907aa01ba18 (diff) | |
| download | angular.js-4421f3d43525437bd939f647604480c1ed126e5e.tar.bz2 | |
fix(docs): update docs to reflect new $location and fix e2e tests
Diffstat (limited to 'docs/content')
| -rw-r--r-- | docs/content/cookbook/deeplinking.ngdoc | 10 | ||||
| -rw-r--r-- | docs/content/cookbook/mvc.ngdoc | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/docs/content/cookbook/deeplinking.ngdoc b/docs/content/cookbook/deeplinking.ngdoc index e49287bb..10c80f21 100644 --- a/docs/content/cookbook/deeplinking.ngdoc +++ b/docs/content/cookbook/deeplinking.ngdoc @@ -43,7 +43,7 @@ The two partials are defined in the following URLs: AppCntl.$inject = ['$route'] function AppCntl($route) { // define routes - $route.when("", {template:'./examples/welcome.html', controller:WelcomeCntl}); + $route.when("/welcome", {template:'./examples/welcome.html', controller:WelcomeCntl}); $route.when("/settings", {template:'./examples/settings.html', controller:SettingsCntl}); $route.parent(this); @@ -61,7 +61,9 @@ The two partials are defined in the following URLs: } }; - function SettingsCntl(){ + SettingsCntl.$inject = ['$location']; + function SettingsCntl($location){ + this.$location = $location; this.cancel(); } SettingsCntl.prototype = { @@ -71,13 +73,13 @@ The two partials are defined in the following URLs: save: function(){ angular.copy(this.form, this.person); - window.location.hash = "#"; + this.$location.path('/welcome'); } }; </script> <div ng:controller="AppCntl"> <h1>Your App Chrome</h1> - [ <a href="#">Welcome</a> | <a href="#/settings">Settings</a> ] + [ <a href="#!/welcome">Welcome</a> | <a href="#!/settings">Settings</a> ] <hr/> <span style="background-color: blue; color: white; padding: 3px;"> Partial: {{$route.current.template}} diff --git a/docs/content/cookbook/mvc.ngdoc b/docs/content/cookbook/mvc.ngdoc index d757baff..4529cd29 100644 --- a/docs/content/cookbook/mvc.ngdoc +++ b/docs/content/cookbook/mvc.ngdoc @@ -26,7 +26,7 @@ no connection between the controller and the view. 'cursor': 'pointer' }; this.reset(); - this.$watch('$location.hashSearch.board', this.readUrl); + this.$watch('$location.search().board', this.readUrl); } TicTacToeCntl.prototype = { dropPiece: function(row, col) { @@ -62,7 +62,7 @@ no connection between the controller and the view. angular.forEach(this.board, function(row){ rows.push(row.join(',')); }); - this.$location.hashSearch.board = rows.join(';') + '/' + this.nextMove; + this.$location.search({board: rows.join(';') + '/' + this.nextMove}); }, readUrl: function(scope, value) { if (value) { @@ -72,8 +72,6 @@ no connection between the controller and the view. this.board[col] = row.split(','); }, this); this.grade(); - } else { - this.reset(); } } }; |
