fix(select): allow use ng-nodel and ng-options(add timeout)

pull/3/head
alex 2016-01-19 15:38:47 +03:00
parent 9ccadd2433
commit 5a0c78e8a6
3 changed files with 10 additions and 10 deletions

View File

@ -9,11 +9,13 @@
.directive('selectpicker', selectpicker);
/** @ngInject */
function selectpicker() {
function selectpicker($timeout) {
return {
restrict: 'A',
link: function( $scope, elem) {
$(elem).selectpicker();
$timeout(function() {
$(elem).selectpicker();
}, 0);
}
};
}

View File

@ -11,7 +11,7 @@
/** @ngInject */
function TablesPageCtrl($scope, $filter) {
$scope.smartTablePageSize = 12;
$scope.smartTablePageSize = 10;
$scope.smartTableData = [
{

View File

@ -1,12 +1,10 @@
<div class="horizontal-scroll">
<div class="form-group select-page-size-wrap ">
<select class="form-control" data-live-search="true" title="Rows on page" selectpicker>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
<label>Rows on page
<select class="form-control selectpicker show-tick" title="Rows on page" selectpicker
ng-model="smartTablePageSize" ng-options="i for i in [5,10,15,20,25]">
</select>
</label>
</div>
<table class="table" st-table="smartTableData">
<thead>