Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

fix(ngModelOptions): add textarea support #7292

Closed
wants to merge 1 commit into from
Closed

fix(ngModelOptions): add textarea support #7292

wants to merge 1 commit into from

Conversation

shahata
Copy link
Contributor

@shahata shahata commented Apr 28, 2014

since directives are sorted by priority and name and ngModel & textarea have the same priority and 'textarea'>'ngModel' (unlike 'input'), textarea in linked first. this is a problem since textarea expect ngModelController.$options to exist and it is created only when ngModel is linked. this is solved easily by moving the creation of $options to pre-link.

fixes #7281

@mary-poppins
Copy link

Thanks for the PR! Please check the items below to help us merge this faster. See the contributing docs for more information.

  • Uses the issue template (#7292)

If you need to make changes to your pull request, you can update the commit with git commit --amend.
Then, update the pull request with git push -f.

Thanks again for your help!

@shahata
Copy link
Contributor Author

shahata commented Apr 28, 2014

Another option is to let all input directives to also require ngModelOptions in addition to ngModel, but I don't like it very much.

@shahata
Copy link
Contributor Author

shahata commented Apr 28, 2014

BTW, I see no reason not to move all of the ngModel linking to pre-link...

@shahata shahata added cla: yes and removed cla: no labels Apr 28, 2014
since directives are sorted by priority and name and `ngModel` & `textarea` have the same priority and 'textarea'>'ngModel' (unlike 'input'), textarea in linked first. this is a problem since textarea expect ngModelController.$options to exist and it is created only when ngModel is linked. this is solved easily by moving the creation of $options to pre-link.

fixes #7281
@petebacondarwin
Copy link
Contributor

LGTM - I also agree with moving the whole lot to pre-link.

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.

ngModelOptions doesn't work for textarea
3 participants