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

Commit d1e4167

Browse files
author
Kamil Kisiela
committed
Add md-radio with valueProp and labelProp
1 parent 131d610 commit d1e4167

File tree

5 files changed

+28
-3
lines changed

5 files changed

+28
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
55
## [Unreleased]
66
### Added
77
- Support for md-select
8+
- Support for md-radio with valueProp and labelProp options
89

910
## [0.0.4] - 2015-11-13
1011
### Removed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ angular.module('myAppName', [
3030
```
3131

3232
# Components
33-
3433
_rest of angular-material directive in near future_
3534

3635
## Fields
@@ -46,13 +45,16 @@ _rest of angular-material directive in near future_
4645
- ngMessages
4746

4847
## Roadmap
48+
4949
- [ ] add md-chips
5050
- [ ] add md-datepicker
5151
- [ ] add md-icon wrapper
5252
- [ ] add md-radio-button and md-radio-group
5353
- [x] add md-select
5454
- [ ] add groups to md-select
55-
- [ ] add roupProp, valueProp, labelProp to md-select
55+
- [ ] add groupProp, valueProp, labelProp to md-select
56+
- [x] add md-radio with valueProp and labelProp
57+
- [ ] add groupProp to md-radio
5658
- [ ] e2e tests
5759

5860
Requests (?). Post an issue.

lib/client/types/radio/radio.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
var {SetModule} = angular2now;
2+
3+
SetModule('formlyMaterial')
4+
.config((formlyConfigProvider, formlyMaterialProvider) => {
5+
6+
formlyConfigProvider.setType({
7+
name: 'radio',
8+
templateUrl: formlyMaterialProvider.templateUrl('lib/client/types/radio/radio.ng.html')
9+
});
10+
11+
});

lib/client/types/radio/radio.ng.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<md-radio-group ng-model="model[options.key]">
2+
<md-radio-button
3+
ng-repeat="option in to.options"
4+
ng-value="option[to.valueProp || 'value']">
5+
{{option[to.labelProp || 'name']}}
6+
</md-radio-button>
7+
</md-radio-group>

package.js

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

7070
// select
7171
'lib/client/types/select/select.js',
72-
'lib/client/types/select/select.ng.html'
72+
'lib/client/types/select/select.ng.html',
73+
74+
// radio
75+
'lib/client/types/radio/radio.js',
76+
'lib/client/types/radio/radio.ng.html'
7377

7478
], client);
7579

0 commit comments

Comments
 (0)