This repository was archived by the owner on Jan 22, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-13
lines changed Expand file tree Collapse file tree 2 files changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,11 @@ export default (formlyConfigProvider) => {
15
15
mdMaxlength : {
16
16
bound : 'md-maxlength'
17
17
} ,
18
+ // XXX angular-formly#8042d2a so we want to keep it compatible
19
+ // with angular-formly releases before that commit
20
+ step : {
21
+ attribute : 'step'
22
+ } ,
18
23
disabled : {
19
24
bound : 'ng-disabled'
20
25
} ,
@@ -38,15 +43,4 @@ export default (formlyConfigProvider) => {
38
43
} ;
39
44
}
40
45
} ) ;
41
-
42
- // add only step attribute because min and max are both built-in
43
- formlyConfigProvider . extras . fieldTransform . push ( ( fields ) => {
44
- return ngModelAttrsTransformer ( fields , ( field ) => (
45
- field . type === 'input' &&
46
- field . templateOptions &&
47
- field . templateOptions . type === 'number'
48
- ) , 'step' , {
49
- attribute : 'step'
50
- } ) ;
51
- } ) ;
52
46
} ;
Original file line number Diff line number Diff line change @@ -118,15 +118,17 @@ describe('formlyMaterial - input type', () => {
118
118
119
119
describe ( 'number type specific' , ( ) => {
120
120
describe ( 'step attribute' , ( ) => {
121
- it ( 'should not be available on non number type' , ( ) => {
121
+ // XXX BE instead of NOT BE because `step` attr is now fully supported
122
+ // angular-formly#8042d2a
123
+ it ( 'should BE available on non number type' , ( ) => {
122
124
compile ( {
123
125
templateOptions : {
124
126
type : 'text' ,
125
127
step : 2
126
128
}
127
129
} ) ;
128
130
129
- expect ( element . attr ( 'step' ) ) . toBeUndefined ( ) ;
131
+ expect ( parseInt ( element . attr ( 'step' ) ) ) . toBe ( field . templateOptions . step ) ;
130
132
} ) ;
131
133
132
134
it ( 'should be available on number type' , ( ) => {
You can’t perform that action at this time.
0 commit comments