material_select does not update display value after selected option has been changed by program
See original GitHub issueI have create an angular directive to initialize select control:
SelectDirective = function($timeout) {
return {
restrict: 'A',
link: function($scope, element, attrs) {
return $timeout(function() {
return $(element).material_select();
}, 50);
}
};
};
to create select control in jade:
.col.s6.input-field
select#priority(md-select, ng-model='vm.priority')
option(value='0') 0
option(value='1') 1
option(value='2') 2
option(value='3') 3
label(for='priority') Priority
The issue is that the select control doesn’t update the display value when the priority value has been changed in controller. However, the priority value is changed according to the selected option value by mouse or key operation.
Is it possible to have a public method to select value in material_select? So that it’s feasible to $watch ng-model value in directive to update the display value by the method.
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Angular 6 Material mat-select change method removed
I have this issue today with mat-option-group. The thing which solved me the problem is using in other provided event of mat-select : ......
Read more >Select | Angular Material
<mat-select> is a form control for selecting a value from a set of options, similar to the native <select> element. You can read...
Read more >Double material select element (second one fetching content
Hey guys, I've encountered problems with the new Material select. If I select a country in select1 the material select freezes and so...
Read more >angular select does not load my selected option | Nerd For Tech
The importance of the compare function compareWith() , a property used with the form control for comparing option values with selected values.
Read more >Angular Material Select Change Event - ConcretePage.com
Angular Material Select provides selectionChange event that emits when the selected value has been changed by the user.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It looks nothing changed to re-initialize the select control after select options or value is changed.
http://materializecss.com/forms.html
Updating/Destroying Select
If you want to update the items inside the select, just rerun the initialization code from above after editing the original select.