"use strict"; (function () { 'use strict'; angular.module('userModule') .service('loginHelpService', ['$http', '$resource', function ($http, $resource) { var resource = $resource('/smartit/rest/contactInfo/search/:locale', {}, { getContacts: { method: 'POST', isArray: true }, getUrl: { method: 'POST', isArray: true } }); this.getContacts = function (locale, params) { return resource.getContacts(locale, params).$promise.then(function (data) { return _.filter(data[0].items, function (item) { return item.phone; }); }); }; this.getUrl = function (locale, params) { return resource.getUrl(locale, params).$promise.then(function (data) { return data[0].items.length ? data[0].items[0] : {}; }); }; } ]); }());