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

Commit 8347449

Browse files
author
Kent C. Dodds
committed
Gives an example of using the result object in a template.
1 parent 572353d commit 8347449

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/views/custom-template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="form-group">
22
<div>Look mah! Custom Templates!</div>
33
<label for="{{id}}">
4-
{{options.label || 'Text'}}
4+
{{result[options.nameKey] ? result[options.nameKey] + ',' : ''}} {{options.label || 'Text'}}
55
{{options.required ? '*' : ''}}
66
</label>
77
<div>{{result[options.key || index]}}</div>

src/views/home.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ app.controller('home', function($scope, $parse, formlyOptions, $window, usingCus
114114
key: 'seeWhatYouType',
115115
type: 'customTemplate',
116116
templateUrl: 'views/custom-template.html',
117-
label: 'Do you like seeing what you type?'
117+
label: 'do you like seeing what you type?',
118+
nameKey: 'firstName'
118119
}, {
119120
key: 'useDirective',
120121
template: '<div custom-field add-smile="true"></div>',

0 commit comments

Comments
 (0)