| author | rougeronj |
| Wed, 25 Mar 2015 15:55:38 +0100 | |
| changeset 39 | b714bcbe915c |
| parent 8 | 824c87a9084c |
| child 47 | dd750778535c |
| permissions | -rw-r--r-- |
| 1 | 1 |
(function(){ |
2 |
'use strict'; |
|
3 |
||
4 |
angular.module('ammicoSearch',['ngResource', 'ngRoute']) |
|
5 |
.config(function ($routeProvider) { |
|
6 |
$routeProvider |
|
7 |
.when('/', { |
|
8 |
templateUrl: 'search/search.html', |
|
9 |
controller: 'searchCtrl' |
|
10 |
}); |
|
11 |
}) |
|
| 2 | 12 |
.controller('searchCtrl', function($scope, $location, $routeParams, searchApi){ |
| 1 | 13 |
console.log('search 6',$scope, $location, $routeParams); |
14 |
$scope.q = $routeParams.q || ''; |
|
|
8
824c87a9084c
(really) better management of slideshowModel with new api.
cavaliet
parents:
7
diff
changeset
|
15 |
$scope.results = searchApi.searchResource({q:$scope.q, of: 'json', synthesis: 'false', nresults:'50', callback: 'JSON_CALLBACK'}).getJsonp(); |
| 1 | 16 |
}); |
17 |
||
18 |
})(); |