I have a bootstrap dropdown to load the countries list by making an external api call. I want to show the three states of behavior(progress,success,error) in the dropdown using ng-show/hide. I am not sure how do i dynamically change ng-show/hide with in a dropdown like below?
1.In Progress (loadCountry =='progress' -Displaying the Loading... text)
2.Binded Successfully (loadCountry=='success' -bind the api response of country's list)
3.Error Message (loadCountry=='error' - If any error occured during the api data retrieval)
How do i insert the behavior for in progress and error in the below bootstrap dropdown using ng-show. I am setting the value for loadCountry scope variable from the directive's controller as progress,success,error automatically as per the flow goes.
<div ng-show="loadCountry== 'success'>
<button class="btn dropdown-toggle" type="button" id="btnCntry"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
{{selectedCountry}}
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="btnCntry">
<li ng-repeat="country in countryList">
<a>{{country.name}}</a>
</ul>
</div>