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); .directive('selectpicker', selectpicker);
/** @ngInject */ /** @ngInject */
function selectpicker() { function selectpicker($timeout) {
return { return {
restrict: 'A', restrict: 'A',
link: function( $scope, elem) { link: function( $scope, elem) {
$(elem).selectpicker(); $timeout(function() {
$(elem).selectpicker();
}, 0);
} }
}; };
} }

View File

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

View File

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