Skip to content

Commit 1a1c340

Browse files
committed
Angualar 1.2 support
No need to break it.
1 parent 0bf2427 commit 1a1c340

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

src/bootstrap-decorator.js

+16-4
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,22 @@ function(decoratorsProvider, sfBuilderProvider, sfPathProvider) {
156156
} else {
157157
// Otherwise we like to check if the instance of the array has changed, or if something
158158
// has been added/removed.
159-
scope.$watchGroup([attrs.sfNewArray, attrs.sfNewArray + '.length'], function() {
160-
watchFn();
161-
onChangeFn();
162-
});
159+
if (scope.$watchGroup) {
160+
scope.$watchGroup([attrs.sfNewArray, attrs.sfNewArray + '.length'], function() {
161+
watchFn();
162+
onChangeFn();
163+
});
164+
} else {
165+
// Angular 1.2 support
166+
scope.$watch(attrs.sfNewArray, function() {
167+
watchFn();
168+
onChangeFn();
169+
});
170+
scope.$watch(attrs.sfNewArray + '.length', function() {
171+
watchFn();
172+
onChangeFn();
173+
});
174+
}
163175
}
164176

165177
// Title Map handling

0 commit comments

Comments
 (0)