Open srenault opened 8 years ago
Hmm, I think this is kind of tricky right now. At least to do it nicely.
I guess we could extend baseMixin
so we can specify a set of attributes which should be skipped (maybe also a way to explicitly define the allowed ones). This would allow to do something like:
function view(ctrl, srcAttribs) {
let outerAttribs = {};
let innerAttribs = {};
callMixin(baseMixin({only: ['checked', 'name', 'value', 'id']}), srcAttribs, innerAttribs);
callMixin(baseMixin({exclude: ['checked', 'name', 'value', 'id']}), srcAttribs, outerAttribs);
}
By default all attributes would be copied over.
The exclude
parameter would specify a set of parameters which will not be copied over (or parsed).
The only
parameter would specify a set of parameters which would be copied or parsed.
All parseable parameters could be exposed as mdl.baseParams
, so we could do the following to handle all the defaults and then only id
and class
.
callMixin(baseMixin({only: baseParams.concat(['id', 'class'])});
I hope I understood your question correctly. Would what I proposed help you?
How do you specify the
name
property to the innerinput
? And forvalue
?More generally , I expect every parameters except special ones like
ripple
to be assigned to the input.