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

Commit 77002ac

Browse files
author
Kamil Kisiela
committed
Add textarea
1 parent 45697fe commit 77002ac

File tree

5 files changed

+35
-2
lines changed

5 files changed

+35
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## [Unreleased]
6+
### Added
7+
- Support for textarea with cols and rows
8+
59
## [0.1.0] - 2015-11-17
610
### Added
711
- Support for md-select with valueProp and labelProp

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ _rest of angular-material directive in near future_
4444
- [ ] add md-chips
4545
- [ ] add md-datepicker
4646
- [ ] add md-icon wrapper
47-
- [ ] add md-radio-button and md-radio-group
4847
- [x] add md-select
4948
- [ ] add groups to md-select
5049
- [x] add valueProp, labelProp to md-select
5150
- [x] add md-radio with valueProp and labelProp
5251
- [ ] add groupProp to md-radio
52+
- [x] add textarea with cols and rows
5353
- [ ] e2e tests
5454

5555
Requests (?). Post an issue.

lib/client/types/textarea/textarea.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
var {SetModule} = angular2now;
2+
3+
SetModule('formlyMaterial')
4+
.config((formlyConfigProvider, formlyMaterialProvider) => {
5+
6+
formlyConfigProvider.setType({
7+
name: 'textarea',
8+
templateUrl: formlyMaterialProvider.templateUrl('lib/client/types/textarea/textarea.ng.html'),
9+
wrapper: ['mdLabel', 'mdMessages', 'mdInputContainer'],
10+
defaultOptions: {
11+
ngModelAttrs: {
12+
rows: {attribute: 'rows'},
13+
cols: {attribute: 'cols'}
14+
}
15+
},
16+
apiCheck: (check) => ({
17+
templateOptions: {
18+
rows: check.number.optional,
19+
cols: check.number.optional
20+
}
21+
})
22+
});
23+
24+
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<textarea ng-model="model[options.key]"></textarea>

package.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ Package.onUse(function (api) {
7373

7474
// radio
7575
'lib/client/types/radio/radio.js',
76-
'lib/client/types/radio/radio.ng.html'
76+
'lib/client/types/radio/radio.ng.html',
77+
78+
// textarea
79+
'lib/client/types/textarea/textarea.js',
80+
'lib/client/types/textarea/textarea.ng.html'
7781

7882
], client);
7983

0 commit comments

Comments
 (0)