client/app/search/search_controller.js
author rougeronj
Tue, 31 Mar 2015 12:21:22 +0200
changeset 45 19f3f0a7fbd7
parent 8 824c87a9084c
child 47 dd750778535c
permissions -rw-r--r--
add idInventory for slides saved from a research and not coming from Jamespot

(function(){
  'use strict';

  angular.module('ammicoSearch',['ngResource', 'ngRoute'])
    .config(function ($routeProvider) {
      $routeProvider
        .when('/', {
          templateUrl: 'search/search.html',
          controller: 'searchCtrl'
        });
    })
    .controller('searchCtrl', function($scope, $location, $routeParams, searchApi){
      console.log('search 6',$scope, $location, $routeParams);
      $scope.q = $routeParams.q || '';
      $scope.results = searchApi.searchResource({q:$scope.q, of: 'json', synthesis: 'false', nresults:'50', callback: 'JSON_CALLBACK'}).getJsonp();
    });

})();