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

Add possibility to change the class name #16

Closed
wants to merge 1 commit into from

Conversation

bbeyssac
Copy link
Contributor

Example : { type: 'checkbox', className: 'md-primary'...)

Example : { type: 'checkbox', className: 'md-primary'...)
@kamilkisiela
Copy link
Collaborator

@bbeyssac Thank you for your contribution! :) Great job!

But I think in this case it would be better to add template manipulator so every field would have templateOptions.className option. It would be even better if user could pass not only a string with class name but an array with bunch of them.

What do you think?

You can create PR with ngModelAttrsTemplateManipulator if you interesed in :) I can help you.

This manipulator could work the same way as theme manipulator (https://github.com/formly-js/angular-formly-templates-material/blob/master/src/runs/theme.js)

ngModelAttrsTransformer could be used

kamilkisiela pushed a commit that referenced this pull request Jan 12, 2016
Added

- (chips) support for templateOptions.disabled (#14) (eea2fcf,
f2d2e40)
- (radio) support for templateOptions.disabled (#13) (e6104ea,
c04f63d)
- (checkbox) support for templateOptions.disabled (bdbe651,
aec4e60)
- (datepicker) support for templateOptions.disabled (41b99d6,
7ee864a)
- (input) support for templateOptions.disabled (2b528c3,
18c819f)
- (select) support for templateOptions.disabled (2bb10e0,
9f76f0e)
- (slider) support for templateOptions.disabled (27d1d2a,
f6b5890)
- (switch) support for templateOptions.disabled (7c1865c,
178ac76)
- (textarea) support for templateOptions.disabled (858f9fa,
8a246f5)
- templateOptions.className option (equivalent to ng-class)
(#15, #16) (718c172, d656b4c)
@bbeyssac
Copy link
Contributor Author

@kamilkisiela It's a good idea. I am newbie with angular-fomrly.

i tested this and it's not working
{
"key": "#######",
"type": "checkbox",
"templateOptions": {
"className" : "md-primary"
}
}

I think than ng-class="to.className" is missing in the pattern. It's the same for "option" component.

@kamilkisiela
Copy link
Collaborator

@bbeyssac I'm not sure what you mean. Could you explain it a little bit more?

It would be better if you post an issue with reproduction (you can use this codepen)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants