Closed cudasteve closed 8 years ago
I really think that you could find another way to accomplish what you're trying to do. Could you create an example of what you're trying to do following these instructions?
Either way, I don't think that we'll be doing anything significant to change the behavior of the ngModelAttrsTemplateManipulator
and I'm sure that we can figure out another way to do what you're trying to do. So I'll go ahead and close this issue. Good luck!
This might be a bit of an edge-case, but...
It'd be nice if there was a way to disable certain features of
ngModelAttrsTemplateManipulator
. The docs have multiple ways of disabling it, but as far as the list of features goes, it's kind of a take-it-all-or-leave-it-all deal.My particular use case was that I liked all the binding, custom validation, etc. but I needed to disable the addition of the
tabindex
attribute. WithngModelAttrs
(or just adding it to the DOM I think) I could have overridden thetabindex
, but I needed to pull it off the element completely. I imagine there are other situations in which someone might want some of the magic without all of it. Perhaps we could pass an object toextras.skipNgModelAttrsManipulator
that gives true/false for various feature names, effectively feature-gating the functionality it provides?By the way, in case anyone's wondering why I couldn't just do
tabindex="-1"
, it was because I was trying to get thefocus
attribute to work on a custom type where thefocus
element was not the same as theng-model
element. Plus, it was using a third-party directive where I couldn't go in and manually addformly-focus="true"
. But I found if I put theng-model
on the outer container, the focus would fall-through to the element that should be focused as long as there were notabindex
attributes above it in the DOM. Although in this case,ng-aria
would have added thetabindex
as well, so it gets pretty messy. Ultimately, I just worked around it, but I think it demonstrates a situation where it'd be nice to break down the all-or-nothing.