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

  1. 'use strict';
  2. angular.module('app.search', ['ngRoute'])
  3. .config(['$routeProvider', function($routeProvider) {
  4. $routeProvider.when('/search/:searchstring', {
  5. templateUrl: 'views/search/search.html',
  6. controller: 'SearchCtrl'
  7. });
  8. }])
  9. .controller('SearchCtrl', function($scope, $http, $routeParams) {
  10. $scope.users = [];
  11. $scope.travels = [];
  12. $scope.loadMorePagination = true;
  13. $scope.page = 0;
  14. $scope.searchString = $routeParams.searchstring;
  15. $http.get(urlapi + 'search/' + $routeParams.searchstring)
  16. .then(function(data) {
  17. console.log('data success travels');
  18. console.log(data);
  19. $scope.users = data.data.users;
  20. $scope.travels = data.data.travels;
  21. }, function(data) {
  22. console.log('data error');
  23. });
  24. });