-
-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use directives that use ngModel ? #50
Comments
Hi @pierre-michalet. I can't think of a graceful way to do this with formFor at the moment. I believe you're essentially requesting parser/formatter support for the Let me think about it a bit. |
Yes, for that special directive. But I use https://github.com/angular-ui/ui-select2 and the directive select2 has to be put on the input so it is not limited to parser/formatter Maybe we can have a template attribute that we can use to specify another template than the default one ? We would still need to copy/paste the template but not the directive <text-field template="smart-float-field.html"></text-field> Or, better, we can copy some attributes from the text-field to the input <text-field input-directives="{'smartFloat': {}, 'anotherDirective': {option: 1}}"></text-field> |
Oh I see. Interesting suggestion! So rather than having to override the whole field template, you could just override the That feature will go out in my next release. :) |
Thanks a lot ! |
…late into overridable partials to allow for easier addition of custom directives requiring access to ngModel
To override either the single-line $templateCache.put('form-for/templates/text-field/_input.html', '...');
$templateCache.put('form-for/templates/text-field/_textarea.html', '...'); I recommend forking the existing templates as a starting point though, to make sure the necessary bindings are all in place. This will go out in the next release (hopefully within a half hour or so). Thanks for your patience. |
Check out release 1.4.3 Enjoy! |
Hi Brian,
I previously had the directive below that converts US numbers into French one
The problem is that I can't use this directive with my new text-field anymore, because ngModel is required
The only solution I came up with is to create a new directive based on textField (actually it's a copy/paste ... apparently it is not possible to inherit directives ) with a new template (also copy/pasted from the text-field template ...) where I can put my directive on the input
It is not very elegant nor maintainable, do you have another way to do that ?
Thanks !
The text was updated successfully, but these errors were encountered: