"use strict";

// http://www.google.com/finance/match?matchtype=matchall&q=msft
// http://www.google.com/finance/match?&q=?matchtype=matchall&q=msft
(function () {
    angular
        .module("conpa")
        .factory("googleService", googleService);

    googleService.$inject = ["$http"];
    function googleService($http) {
        var service = {
            quoteLookup: quoteLookup
        };

        return service;

        function quoteLookup(query) {
            var url = "http://www.google.com/finance/match?" +
                    "matchtype=matchall";

            return $http.get(url, {
                params: {
                    q: query
                }
            }).then(function (res) {
                return res.data.matches.map(function (quote) {
                    return {
                        symbol: quote.t,
                        name: quote.n,
                        exchDisp: quote.e,
                        type: quote.id
                    };
                });
            });
        }
    }

}());

"use strict";

(function () {
    angular
        .module("conpa")
        .factory("googleService", googleService);

    googleService.$inject = ["$http"];
    function googleService($http) {
        var service = {
            quoteLookup: quoteLookup
        };

        return service;

        function quoteLookup(query) {
            var url = "http://www.google.com/finance/match?" +
                    "matchtype=matchall";

            return $http.get(url, {
                params: {
                    q: query
                }
            }).then(function (res) {
                return res.data.matches.map(function (quote) {
                    return {
                        symbol: quote.t,
                        name: quote.n,
                        exchDisp: quote.e,
                        type: quote.id
                    };
                });
            });
        }
    }

}());

Remove url commented in google sevice.
Remove url commented in google sevice.
