Unable to bind NgModel to Select with static options
See original GitHub issueWe have tried multiple ways of doing this, but it doesnt seem to be working. Whenever we try to bind a select with ngModel the (already populated) initial value never gets set. On the example project it does… I cant tell what is different, I know there is a thrid part issue with the modal options (materializecss causing that) but with this I am at a loss… this is an absolute must have, and its not working as intended, is there some sort of configuration i am missing?
<mz-select-container class="col s6">
<select mz-select
id="options-select"
[label]="'Label'"
[placeholder]="'Select a Title'"
[(ngModel)]="editTherapist.title">
<option [ngValue]=1>BCBA</option>
<option [ngValue]=2>RBT</option>
</select>
</mz-select-container>
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Angular error: "Can't bind to 'ngModel' since it isn't a known ...
In order to use two-way data binding for form inputs you need to import the FormsModule package in your Angular module.
Read more >Angular Select List Value not binding with Static Values
In Angular 1.3 I was simply able to bind these static values using ng-model like this: <select class="form-control-small" ng-model="view.
Read more >can't bind to 'items' since it isn't a known property of 'ng-select'
Uncaught Error: Template parse errors: Can't bind to 'ngModel' since it isn't a known property of 'ng-select'. 1. If 'ngModel' is an Angular...
Read more >Can't bind to 'ngModel' since it isn't a known property of 'input'
I'm getting this error even though I imported the FormsModule. Here is my html login form.
Read more >NgModule FAQ - Angular
What does "Can't bind to 'x' since it isn't a known property of 'y'" mean?link ... An NgModule can export a combination of...
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 FreeTop 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
Top GitHub Comments
Doesn’t work either way, we have moved onto using Reactive forms and setting the values that way
Hi @detchison,
Thanks for reporting the issue. With your code sample I’ve been able to reproduce the problem. The demo application example that works with
ngModel
usesngFor
on options. If I use it on your example it works great.We are going to fix it with static options but in the meanwhile you could use it that way…
example.component.html
example.component.ts