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

Commit a6232bb

Browse files
committed
added abilit to set a selects default property that works with the new way select data is handled, fixes #44
1 parent 60a110a commit a6232bb

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

src/directives/bootstrap/formly-field-select.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
ng-model="value"
1010
ng-required="options.required"
1111
ng-disabled="options.disabled"
12-
ng-init="value = options.options[options.default]"
12+
ng-init="value = options.default"
1313
ng-options="option.name as option.name group by option.group for option in options.options">
1414
</select>
1515
<p id="{{id}}_description" class="help-block" ng-if="options.description">{{options.description}}</p>

src/directives/formly-field-select.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
ng-model="value"
99
ng-required="options.required"
1010
ng-disabled="options.disabled"
11-
ng-init="value = options.options[options.default]"
11+
ng-init="value = options.default"
1212
ng-options="option.name as option.name group by option.group for option in options.options">
1313
</select>
1414
<p id="{{id}}_description" ng-if="options.description">{{options.description}}</p>

src/views/home.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ app.controller('home', function($scope, $parse, formlyOptions, $window, usingCus
125125
key: 'transportation',
126126
type: 'select',
127127
label: 'How do you get around in the city',
128+
default: 'Skateboard',
128129
options: [
129130
{
130131
name: 'Car',

0 commit comments

Comments
 (0)