You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

28 lines
921 B

'use strict';
angular.module('app.search', ['ngRoute'])
.config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/search/:searchstring', {
templateUrl: 'views/search/search.html',
controller: 'SearchCtrl'
});
}])
.controller('SearchCtrl', function($scope, $http, $routeParams) {
$scope.users = [];
$scope.travels = [];
$scope.loadMorePagination = true;
$scope.page = 0;
$scope.searchString = $routeParams.searchstring;
$http.get(urlapi + 'search/' + $routeParams.searchstring)
.then(function(data) {
console.log('data success travels');
console.log(data);
$scope.users = data.data.users;
$scope.travels = data.data.travels;
}, function(data) {
console.log('data error');
});
});