Skip to content
This repository

ngModelController looses scope binding when using primitives in isolated scope #1913

Closed
richidd opened this Issue · 3 comments

2 participants

Richi Pete Bacon Darwin
Richi

I was about to write a pulldown menu directive and came across with the following issue that i posted to stackoverflow.

When you use an isolated scope in a directive and pass a primitiv value to ngModel the controller will not write the data back to the parent scope + the view(of course)

the stackoverflow entry has js fiddles: http://stackoverflow.com/questions/14577822/ngmodel-doent-pass-data-back-to-parent-scope-in-directive

Pete Bacon Darwin
Collaborator

This is just the way javascript prototypical inheritance works: see https://github.com/angular/angular.js/wiki/The-Nuances-of-Scope-Prototypal-Inheritance
Closing this one for now. If you feel there is more to be discussed then reopen with further issues.

Richi

Shouldn't the framwork somehow be able to handle that. For example somehow transform that input into an object. It is going throu an eval anyways. In the discribed case this behavior seems like a bug to me. Frameworks should work as expected. There should be no need to know about the whole complex background. Eventhough after reading the linked content, its quite clear what happened.

Pete Bacon Darwin
Collaborator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.