#NgModel issues

9 messages · Page 1 of 1 (latest)

daring ridge
#

the ngmodel is not receiving the value from the select when it changes, also it doesn't show the selected option even though they have the same value being an empty string, how to fix this?

dark maple
#

g!badeyes @daring ridge

half elbowBOT
#

Hi @daring ridge, could you please try to avoid posting pictures/screenshots of code (especially photos of a physical screen). Screenshots are more difficult to read as copied code and they do not allow people answering to quickly copy and adjust your code to provide you with an answer.

For copy/pasting code, you can use the following snippet to have your code formatted and syntax highlighted by Discord. Replace ts with the language you are copying (i.e. html, js, css, etc)
```ts
// your code goes here
```

daring ridge
#

sorry one sec

#
<select
            class="form-select form-select-solid select2-hidden-accessible"
            data-control="select2"
            data-placeholder="In Progress"
            data-hide-search="true"
            data-select2-id="select2-data-10-ibk8"
            tabindex="-1"
            aria-hidden="true"
            data-kt-initialized="1"
            [(ngModel)]="governorate" 
          >
          <option value="" disabled selected> Choissez le gouvernorat</option>
          <ng-container *ngFor="let gouvernorate of gouvernorates; let i = index">
            <option [value]="gouvernorate" >{{ gouvernorate }}</option>
          </ng-container>
          </select>
#
governorate: string = "";
dark maple
#

Why in some place gouvernorate misses the u char?

daring ridge
#

o yea my brain is being fried by words that are similar in english and french, I'll change it but it's not the cause of the issue here right?

dark maple
#

Better if you post complete ts code for that component.