Skip to content

Commit 1b29e0a

Browse files
committed
Preparing for release!
1 parent f9ce6a9 commit 1b29e0a

File tree

5 files changed

+54
-18
lines changed

5 files changed

+54
-18
lines changed

README.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,32 @@ Angular Bootstrap Decorator
33

44
For https://github.com/Textalk/angular-schema-form
55

6-
The new Bootstrap Decorator. Work in Progress. Consider it BETA quality.
6+
This is the new Bootstrap Decorator! That means a Bootstrap 3 frontend for the Angular Schema Form
7+
project. The former Bootstrap decorator used to be included in the main repo, but has now moved
8+
here.
79

8-
* Uses the new builder structure for faster form building.
9-
* No need for <bootstrap-decorator> tags anymore!
10+
The big difference is that it now uses the new builder in, for more info on the builder see
11+
[our blog](https://medium.com/@SchemaFormIO/the-new-builder-pt-1-61fadde3c678).
12+
13+
The biggest change for users is that the form no longer contains any `<bootstrap-decorator>` tags
14+
since they are no longer needed.
15+
16+
Install
17+
-------
18+
```sh
19+
bower install angular-schema-form-bootstrap
20+
```
21+
or
22+
23+
```sh
24+
npm install angular-schema-form-bootstrap
25+
```
26+
27+
And then include `bootstrap-decorator.min.js`. Note that angular-schema-form >= 0.8.6 is needed.
28+
29+
30+
Future
31+
------
32+
Using the new builder opens up for a lot of optimization. Primarily we can get rid of a lot of small
33+
watches by using build helpers. For instance, slapping on a `sf-changed` directive *only* if the
34+
form definition has an `onChange` option.

bootstrap-decorator.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,22 @@ function(decoratorsProvider, sfBuilderProvider, sfPathProvider) {
173173
} else {
174174
// Otherwise we like to check if the instance of the array has changed, or if something
175175
// has been added/removed.
176-
scope.$watchGroup([attrs.sfNewArray, attrs.sfNewArray + '.length'], function() {
177-
watchFn();
178-
onChangeFn();
179-
});
176+
if (scope.$watchGroup) {
177+
scope.$watchGroup([attrs.sfNewArray, attrs.sfNewArray + '.length'], function() {
178+
watchFn();
179+
onChangeFn();
180+
});
181+
} else {
182+
// Angular 1.2 support
183+
scope.$watch(attrs.sfNewArray, function() {
184+
watchFn();
185+
onChangeFn();
186+
});
187+
scope.$watch(attrs.sfNewArray + '.length', function() {
188+
watchFn();
189+
onChangeFn();
190+
});
191+
}
180192
}
181193

182194
// Title Map handling

0 commit comments

Comments
 (0)