Basic search implemented.

This commit is contained in:
Julien Fontanet 2013-11-14 15:58:10 +01:00
parent dab9a9ed15
commit 76a919b7bf
3 changed files with 19 additions and 6 deletions

View File

@ -1,5 +1,8 @@
'use strict'
angular.module('xoWebApp')
.controller 'NavBarCtrl', ($scope) ->
.controller 'NavBarCtrl', ($scope, $location) ->
$scope.user = ''
$scope.ensureListView = ->
$location.path '/list'

View File

@ -1,6 +1,8 @@
<!-- TODO: print a message when no entries. -->
<!-- The display depends of the type. -->
<ng-switch
ng-repeat="object in objects"
ng-repeat="object in objects | filter:listFilter"
on="object.type"
> <!-- | orderBy:['type', 'name_label'] -->
@ -249,5 +251,5 @@
</div>
<!-- /SR. -->
</ng-switch>
<!-- /Display depends of the type. -->
</ng-switch>
<!-- /Display depends of the type. -->

View File

@ -29,9 +29,17 @@
(https://github.com/twbs/bootstrap/issues/9950. -->
<div class="input-group">
<input type="text" class="form-control inverse" placeholder="">
<input
type="text"
class="form-control inverse"
placeholder=""
ng-model="$root.listFilter"
ng-change="ensureListView()"
>
<span class="input-group-btn">
<button type="submit" class="btn btn-search"><i class="fa fa-search"></i></button>
<button type="button" class="btn btn-search" ng-click="ensureListView()">
<i class="fa fa-search"></i>
</button>
</span>
</div>
</form>