diff -r e3d3cd7a676a -r 8b87432acffc client/app/components/app_service.js --- a/client/app/components/app_service.js Wed Dec 02 11:41:53 2015 +0100 +++ b/client/app/components/app_service.js Wed Dec 02 18:07:42 2015 +0100 @@ -1,7 +1,7 @@ (function(){ 'use strict'; - + angular.module('ammicoCommon', ['ngRoute']) .factory('Book', function($resource, context) { var books = $resource(context.urls.ammicoUrl+'books/:idBook', {idBook:'@id', idExpo: context.idExpo}, {update: { method: 'PUT'}}); @@ -9,7 +9,7 @@ }) .factory('Slide', function($resource, context, $modal) { var slides = $resource(context.urls.ammicoUrl+'slides/:idSlide', {idSlide:'@id'}, {update: { method: 'PUT'}}); - + angular.extend(slides.prototype, { toggleFavorite: function () { @@ -51,7 +51,7 @@ } } }); - + return slides; }) .factory('Order', function($resource, context) { @@ -74,7 +74,7 @@ }) .service('searchApi', function($resource, context) { this.searchResource = function(params){ - return $resource(context.urls.searchUrl, + return $resource(context.urls.searchUrl, { callback: 'JSON_CALLBACK' }, @@ -84,35 +84,20 @@ params: params, isArray: false, transformResponse: function(data){ - var i, j; - // Transform meta list into meta dict - if (typeof data.hits !== 'undefined'){ - var nb = data.hits.length; - for(i=0;i