Comments (13)
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)
from ui-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.
Inside AngularJS documentation they use:
<input type="number" ng-model="size" name="size"
min="0" max="10" integer />
<input type="text" ng-model="length" name="length" smart-float />
Here aswell:
<input type="text" name="input" ng-model="text"
ng-pattern="word" required ng-trim="false">
Even todomvc:
<input id="new-todo" placeholder="What needs to be done?" ng-model="newTodo" autofocus>
And the AngularJS documentation for NgModelController/$setViewValue/$viewValue shows:
<textarea ng-model="userContent"></textarea>
element.html(ngModel.$viewValue || '');
...
ngModel.$setViewValue(html);
from ui-select.
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.
A simple way to reproduce this problem:
.directive('test', function(){
return {
scope: true,
require: 'ngModel',
link: function($scope, $elm, $attrs, ngModel) {
ngModel.$setViewValue('hi');
}
}
})
I recommend instead opening an issue on AngularJS and asking their advice instead.
from ui-select.
Thanks for the explanations and opening an issue on AngularJS.
from ui-select.
I'm not an asshole in real life. I just play one on television.
from ui-select.
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).
from ui-select.
@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.
from ui-select.
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.
from ui-select.
I'm surprised no one has been complaining about the lack of multiselect yet. That's like the one major feature i care about.
from ui-select.
@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. 👍
from ui-select.
Here is a nice explanation:
https://github.com/angular/angular.js/wiki/Understanding-Scopes
from ui-select.
Sorry for bringing it back to life again, but... $parent arent updating my model also
function controller(){
$scope.editingGeneralCondition = {};
}
<ui-select name="generalCondition" ng-model="$parent.editingGeneralCondition" ng-required="true" theme="bootstrap">
Most probably, I'm making some foolish mistake here.
from ui-select.
@thiagodelgado111 just do obj.property
instead of $parent.property
from ui-select.
Related Issues (20)
- Angular parses selectize/choices.tpl.html template with syntax error
- Is there a plan for a new release? HOT 2
- Mouse does not change active item
- common.css is missing a closing bracket
- Removing active class when selected value was removed
- npm v. 0.19.8 is outdated
- Scrolling to the selected occurrence appears to not work, despite the bugfix in 2016.
- Need a way to register and fire a callback on clicking a tag (In addition to making it the active match) in a multiple select list.
- The selected item is 'disappear' if scroll down/up then scroll back HOT 1
- Angular 1.7 breaks close button HOT 1
- unsafe:javascript:; multiselect (select2) breaks in strict Content Security Policy apps, HOT 2
- Clear value when it is no longer available in the option list
- Bug on change ng-disable when using Multiple Select HOT 1
- No releases since April 2017 HOT 2
- 您好,数据量很多的时候下拉框加载很慢,比如我有1000条数据,点下拉的时候就延迟了三秒钟的样子,请问这个该怎么弄呢,这个优化弄了很多天了,请大佬告诉一下解决办法,谢谢啦 HOT 3
- uis-open-close not working for version 0.19.8
- i have jquery select2 applied in my project but now i want to implement that same in angular js without using jqueryt HOT 2
- ui-select into ui-select trouble HOT 2
- Opening drop down list problem
- Using With typescript
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ui-select.