You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 2, 2019. It is now read-only.
Repository navigation
This repository was archived by the owner on Oct 2, 2019. It is now read-only.
ng-model not working with a simple variable on $scope #18
Try $parent.myItem. Also, you're using angular incorrectly, there is lots of documentation on your specific issue as it's not specific to this repo. Try the same thing with a vanilla form input (non-select)
You're using angular incorrectly [...] Try the same thing with a vanilla form input (non-select)
Are you sure of that? I've been using AngularJS a lot since the 1.0 days and never heard about that. Could you please point out to some documentation, I'm missing something.
This isn't exactly a bug with ui-select. This is sort of a 'symptom' of the latest versions of AngularJS. By creating a child scope, the ngModelController is now inside of this child scope. I believe in the past this didn't use to be the case (not sure).
Regardless, after mulling it over, I'm not exactly sure how to go about fixing it without dropping the use of ngModel which doesn't make sense.
Btw, for the time-being if you MUST use this approach, you can bypass this issue by doing $parent.myVal which is just as liable to break as any other non-object-property solution (and generally why the core team considers it wrong).
@tkrotoff any interest in being added as a collaborator to this project? I'm not sure how active @dimirc is at the moment since he may have completed the features he needed.
Why not but I won't add features since I (my client) don't have currently the need for them.
I can refactor the code a bit, remove some hardcoded stuffs, improve doc and examples and simply make it work: I don't think for instance that the Selectize theme has ever been tested.
Also my knowledge on directives techniques is somehow quite limited (I simply re-use from others), I don't fully understand file select.js.
@tkrotoff any interest in being added as a collaborator to this project? I'm not sure how active @dimirc is at the moment since he may have completed the features he needed.
I've being very busy but will catch up this weekend, good to see more people involve. 👍
Activity
ProLoser commentedon Feb 10, 2014
Try
$parent.myItem. Also, you're using angular incorrectly, there is lots of documentation on your specific issue as it's not specific to this repo. Try the same thing with a vanilla form input (non-select)tkrotoff commentedon Feb 10, 2014
Are you sure of that? I've been using AngularJS a lot since the 1.0 days and never heard about that. Could you please point out to some documentation, I'm missing something.
Inside AngularJS documentation they use:
Here aswell:
Even todomvc:
And the AngularJS documentation for NgModelController/$setViewValue/$viewValue shows:
ProLoser commentedon Feb 10, 2014
This isn't exactly a bug with
ui-select. This is sort of a 'symptom' of the latest versions of AngularJS. By creating a child scope, thengModelControlleris now inside of this child scope. I believe in the past this didn't use to be the case (not sure).Regardless, after mulling it over, I'm not exactly sure how to go about fixing it without dropping the use of
ngModelwhich doesn't make sense.A simple way to reproduce this problem:
I recommend instead opening an issue on AngularJS and asking their advice instead.
tkrotoff commentedon Feb 10, 2014
Thanks for the explanations and opening an issue on AngularJS.
ProLoser commentedon Feb 10, 2014
I'm not an asshole in real life. I just play one on television.
ProLoser commentedon Feb 10, 2014
Btw, for the time-being if you MUST use this approach, you can bypass this issue by doing
$parent.myValwhich is just as liable to break as any other non-object-property solution (and generally why the core team considers it wrong).ProLoser commentedon Feb 11, 2014
@tkrotoff any interest in being added as a collaborator to this project? I'm not sure how active @dimirc is at the moment since he may have completed the features he needed.
tkrotoff commentedon Feb 11, 2014
Why not but I won't add features since I (my client) don't have currently the need for them.
I can refactor the code a bit, remove some hardcoded stuffs, improve doc and examples and simply make it work: I don't think for instance that the Selectize theme has ever been tested.
Also my knowledge on directives techniques is somehow quite limited (I simply re-use from others), I don't fully understand file select.js.
ProLoser commentedon Feb 12, 2014
I'm surprised no one has been complaining about the lack of multiselect yet. That's like the one major feature i care about.
dimirc commentedon Feb 14, 2014
I've being very busy but will catch up this weekend, good to see more people involve. 👍
sroe commentedon Oct 15, 2014
Here is a nice explanation:
https://github.com/angular/angular.js/wiki/Understanding-Scopes
Basic Lesson saving + Lesson Model treatment
thiagodelgado111 commentedon Feb 26, 2015
Sorry for bringing it back to life again, but... $parent arent updating my model also
Most probably, I'm making some foolish mistake here.
ProLoser commentedon Feb 26, 2015
@thiagodelgado111 just do
obj.propertyinstead of$parent.property