Skip to content

Commit

Permalink
Fixed a case when watcher is provided in annotated array form rathe…
Browse files Browse the repository at this point in the history
…r than as a function
  • Loading branch information
artch committed Sep 19, 2014
1 parent 2706f22 commit 84602f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions example/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ app.config(function($routeSegmentProvider, $routeProvider) {
.within()

.segment('home', {
default: true,
'default': true,
templateUrl: 'templates/section1/home.html'})

.segment('itemInfo', {
Expand All @@ -41,7 +41,7 @@ app.config(function($routeSegmentProvider, $routeProvider) {
.within()

.segment('tab1', {
default: true,
'default': true,
templateUrl: 'templates/section1/tabs/tab1.html'})

.segment('tab2', {
Expand Down Expand Up @@ -143,7 +143,7 @@ app.config(function($routeSegmentProvider, $routeProvider) {
.segment('inlineChildren', {
// no template here
controller: 'SlowDataCtrl',
default: true,
'default': true,
resolve: {
data: function($timeout) {
return $timeout(function() { return 'SLOW DATA CONTENT'; }, 2000);
Expand Down
2 changes: 1 addition & 1 deletion src/route-segment.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ mod.provider( '$routeSegment',
if(params.watcher) {

var getWatcherValue = function() {
if(!angular.isFunction(params.watcher))
if(!angular.isFunction(params.watcher) && !angular.isArray(params.watcher))
throw new Error('Watcher is not a function in segment `'+name+'`');

return $injector.invoke(
Expand Down

0 comments on commit 84602f8

Please sign in to comment.