Skip to content
This repository was archived by the owner on Apr 30, 2018. It is now read-only.

Commit 4d6a3d5

Browse files
committed
made uniqueFormId required
1 parent 6812ca8 commit 4d6a3d5

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ Example data as it would be set in the controller
7979
console.log('form submitted:', $scope.formData);
8080
};
8181
```
82+
### Creating Forms
83+
Forms can be customized with the options below.
84+
85+
#### uniqueFormId (string, optional)
86+
This is used to
8287

8388
### Creating Form Fields
8489
When constructing fields use the options below to customize each field object. You must set at least a `type` or `templateUrl`.

src/directives/formly-field.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ angular.module('formly.render')
4646
transclude: true,
4747
scope: {
4848
optionsData: '&options',
49-
formId: '@formId',
50-
index: '@index',
49+
formId: '=formId',
50+
index: '=index',
5151
value: '=formValue'
5252
},
5353
link: function fieldLink($scope, $element, $attr) {

src/directives/formly-form.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
options="field"
44
form-value="result[field.key||$index]"
55
class="formly-field"
6-
form-id="{{options.uniqueFormId}}"
7-
index="{{$index}}">
6+
form-id="options.uniqueFormId"
7+
index="$index">
88
</formly-field>
99
<button type="submit"
1010
ng-hide="options.hideSubmit">

src/directives/formly-form.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ angular.module('formly.render')
1111
result: '=result',
1212
formOnParentScope: '=name'
1313
},
14-
controller: function formController($scope, $element) {
15-
},
1614
compile: function (scope, iElement, iAttrs, controller, transcludeFn) {
1715
return {
1816
post: function (scope, ele, attr, controller) {

src/views/home.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ app.controller('home', function($scope, $parse, $rootScope) {
140140
}];
141141

142142
$scope.formOptions = {
143+
uniqueFormId: 'formly',
143144
submitCopy: 'Save'
144145
};
145146
$scope.submittedData = null;

0 commit comments

Comments
 (0)