0

While migrating old angular app to angular 4 I came across this in .js file customized dropdown

hps-dropdown model="studentRequest.CountryType" reset-id="countryResetId" 
is-required="false" options="countryOptions" reset- 
id="resetCountryRequestResetId">hps-dropdown

How to use the resetid in angular 4 Code:

     function setDefaultCountry() {
                var queryParams = $location.search();
                if (queryParams.Region) {
                   ---
                   ---
                    });
                    if (RegionsArray.length > 0) {
                        Code = selectedArray[0].id;
                        // Reset the id to reflect values in drop down
                        this.countryResetId = new Date();
                    }
                }
            }

how to call the same in angular 4 to rest the same But when I started implementing used normal combo box instead of above template and bind the required options.what is the use of rest-id when calling countries info.

    <select class="form-control" id="country" name="country" (change)="onCountryChange($event.target.value)" [(ngModel)]="countrySelected" required>
                                    <option value='' disabled="disabled">select</option>
                                    <option *ngFor="let country of countryList">{{country.name}}</option>
    </select>

Basically First countries will be loaded then based on it states will be loaded.

2
  • So you want the default value for drop-down must be something like 'Select Country' and once select the country the states should be get loaded... Correct me if my understanding is wrong ? Commented Nov 16, 2019 at 18:12
  • Show your code. Commented Nov 16, 2019 at 18:12

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.