morrisjdev / ng-metro4

Angular components for Metro4 UI library in modern ui style.
https://morrisjdev.github.io/ng-metro4/
MIT License
38 stars 12 forks source link

Input Select #13

Open Rodolfo-XDR opened 4 years ago

Rodolfo-XDR commented 4 years ago

I don't know if it's a problem directly from Metro4 or NgMetro but let's say I want to have a Dynamic Selection. (In my case, I wanted to create a selector with Countries and States so when I change input select "countries" then my input select "states" would update to the country selected.)

In summary, input select doesn't update values when handling a dynamic options list.

EDIT--------

Also, when trying to set up the input select value let's say: <select [(ngModel)]="commodity.vehicle_id" name="vehicles" id="vehicles" data-role="select">

this.commodity.vehicle_id = 0

The Select Input, does not update visually, it does go to value 0, but visually doesn't. still shows another value.

compumania931106 commented 4 years ago

I have the same problem, still can't find the solution?

compumania931106 commented 4 years ago

I have found the solution, when using the m4-select tag, I put a boolean variable, which by default is false, when I have the values obtained on the server, when I have the array built, I set the flag to true and it is already displayed the data in the select

Rodolfo-XDR commented 4 years ago

@compumania931106 where do you set the boolean flag?

EDIT

Oh I get it, like you don't show the m4-select until you have already built the array data that will be displayed in the input

Thank you bro, you saved me <3