(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();
});
})();