Skip to content

Commit 84602f8

Browse files
committed
Fixed a case when watcher is provided in annotated array form rather than as a function
1 parent 2706f22 commit 84602f8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

example/app.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ app.config(function($routeSegmentProvider, $routeProvider) {
3030
.within()
3131

3232
.segment('home', {
33-
default: true,
33+
'default': true,
3434
templateUrl: 'templates/section1/home.html'})
3535

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

4343
.segment('tab1', {
44-
default: true,
44+
'default': true,
4545
templateUrl: 'templates/section1/tabs/tab1.html'})
4646

4747
.segment('tab2', {
@@ -143,7 +143,7 @@ app.config(function($routeSegmentProvider, $routeProvider) {
143143
.segment('inlineChildren', {
144144
// no template here
145145
controller: 'SlowDataCtrl',
146-
default: true,
146+
'default': true,
147147
resolve: {
148148
data: function($timeout) {
149149
return $timeout(function() { return 'SLOW DATA CONTENT'; }, 2000);

src/route-segment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ mod.provider( '$routeSegment',
404404
if(params.watcher) {
405405

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

410410
return $injector.invoke(

0 commit comments

Comments
 (0)