Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # UI-SELECT
- <ui-select on-select="clearCountries()" ng-model="customer.country_id" theme="bootstrap">
- <ui-select-match placeholder="Wpisz minimum 3 znaki...">{{$select.selected.name}}</ui-select-match>
- <ui-select-choices refresh="checkCountry($select.search)" refresh-delay="500" repeat="country.id as country in countries | filter: $select.search">
- <div ng-bind-html="country.name | highlight: $select.search"></div>
- </ui-select-choices>
- </ui-select>
- # CONTROLLER FUNCTION
- $scope.checkCountry = function(country_name){
- if (country_name.length >= 3){
- DataFactory.search('countries', country_name, 1, 20).then(function(result){
- $scope.countries = result.plain()
- })
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement