File: knownlimitations.md

package info (click to toggle)
libjs-angular-schema-form 0.8.13-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,564 kB
  • sloc: javascript: 17,261; makefile: 16
file content (33 lines) | stat: -rw-r--r-- 1,228 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Known Limitations
=================

### Angular Version
Schema Form works with AngularJS version 1.2.x or above, but version 1.3.x is recommended.

This is because a bug in AngularJS 1.2 [#8039](https://github.com/angular/angular.js/issues/8039),
which means that the ```ng-model``` directive has problem with values that uses a bracket notation instead of dot notation.
```html
<!-- dot notation -->
<input ng-model="foo.bar.baz">

<!-- bracket notation -->
<input ng-model="foo['bar']['baz']">
```

So what does that mean for you as a user of Schema Form? Basically it boils down to that if you use AngularJS 1.2.x
Schema Form uses dot notation, which means your property names in the JSON schema *must not contain any hyphens or other
characters dot notation cannot handle*.

Example schema that only works in 1.3
```javascript
{
  "type": "object",
  "properties": {
    "key-with-hyphen": { "type": "string" },
  }
}
```

The "complex keys" example schema illustrates this as well.
For more background check out issue [#41](https://github.com/Textalk/angular-schema-form/issues/41) and the PR that fixed
it, [PR 43](https://github.com/Textalk/angular-schema-form/pull/43). Thanks to @mike-marcacci for his excellent work!