Monday 15 February 2016

ui select in angularJS

<ui-select ng-model="CountryObj.CountryName">

<ui-select-match placeholder="-- Select User --">

{{$select.selected.Name}}

</ui-select-match>

<ui-select-choices repeat="s.Id as s in CountryData" ui-disable-choice="s.IsValid== false">

<div class="container-fluid">

<div class="row">

<div class="col-xs-8">

{{s.Name}}

</div>

</div>

</div>

</ui-select-choices>

</ui-select>

angularCode:_



angular.forEach(CountryNames, function (value) {

var nameObj = {};


nameObj.Id= value.Id;
nameObj.CountryName= value.CountryName;

nameObj.IsValid = true;


$scope.CountryData.push(nameObj);

});
 

Tuesday 9 February 2016