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

Unable to use ng-model-options on the same tag as ng-app when ng-app is on html tag #16535

Closed
1 of 3 tasks
mdelorimier opened this issue Apr 20, 2018 · 5 comments
Closed
1 of 3 tasks

Comments

@mdelorimier
Copy link

mdelorimier commented Apr 20, 2018

I'm submitting a ...

  • bug report
  • feature request
  • other

Current behavior:

When using ngModelOptions on the same tag as the ngApp, the value of defaultModelOptions gets set to undefined. This causes errors for every ngModel directive in the template.
The error seems to come from NgModelOptionsController $onInit where the parentOptions is undefined and the createChild method can't be executed.

Expected / new behavior:

There should not be an error when a ngModelOption is defined on the same tag as an ngApp.
Or, it should be present in the migration documentation.

Minimal reproduction of the problem with instructions:

https://plnkr.co/edit/jOmVWDvIFuOyOWB2

AngularJS version: 1.6.10

Browser: Chrome 65, probably in all browsers

Anything else:

@Narretz
Copy link
Contributor

Narretz commented Apr 21, 2018

Hi, thanks for the report. From which version did you upgrade to 1.6.10?

@mdelorimier
Copy link
Author

mdelorimier commented Apr 21, 2018 via email

@Narretz
Copy link
Contributor

Narretz commented Apr 24, 2018

Marke it as a regression. I'm not sure we'll do another 1.6. release, though - maybe you'll have to upgrade to 1.7 straight.

@mdelorimier
Copy link
Author

mdelorimier commented Apr 24, 2018 via email

@Narretz Narretz changed the title Unable to use ng-model-options on the same tag as ng-app Unable to use ng-model-options on the same tag as ng-app when ng-app is on html tag Apr 27, 2018
@Narretz
Copy link
Contributor

Narretz commented Apr 27, 2018

Just noticed that this only happens when ngApp is on the html tag - maybe that's because this is the top most tag in an html document.

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

No branches or pull requests

3 participants