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

Commit ea25abf

Browse files
author
Kent C. Dodds
committed
Closes #40. Adding result as a field that can be used to bind through isolate scopes. Updating an example to show how that is done.
1 parent c8ae371 commit ea25abf

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,10 @@ formlyOptionsProvider.setOption({
488488

489489
Returns a copy of the current options. This is used internally.
490490

491+
## Tips and Tricks
492+
493+
Please see [the Wiki](https://github.com/nimbly/angular-formly/wiki) for tips and tricks from the community.
494+
491495
## Roadmap
492496

493497
## Release Notes

src/directives/formly-field.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ angular.module('formly.render')
88
optionsData: '&options',
99
formId: '=formId',
1010
index: '=index',
11-
value: '=formValue'
11+
value: '=formValue',
12+
result: '=formResult'
1213
},
1314
link: function fieldLink($scope, $element, $attr) {
1415
var template = $scope.options.template;

src/directives/formly-form.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<form class="formly" role="form">
22
<formly-field ng-repeat="field in fields"
33
options="field"
4+
form-result="result"
45
form-value="result[field.key||$index]"
56
form-id="options.uniqueFormId"
67
index="$index"

src/views/custom-template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{{options.label || 'Text'}}
55
{{options.required ? '*' : ''}}
66
</label>
7-
<div>{{value}}</div>
7+
<div>{{result[options.key || index]}}</div>
88
<input type="text"
99
class="form-control"
1010
id="{{id}}"

0 commit comments

Comments
 (0)