Parsing Error: Unexpected token
<p>I am working on a MEAN STACK application and I am trying to create a <code>AngularJS</code> factory that makes use of <code>$http</code>. Below is the code of my <code>gMapService.js</code>.  </p>

<p><strong>gMapService.js</strong>  </p>

<pre><code>var myApp = myApp.factory("gMapService",['$http', function($http){
var urlBase = "https://mymapservice.com/api/function/json";
    return {
        function1: function (arg) {
            return{
                $http.get(urlBase, {
                    cache: true,
                    headers:{
                      "Content-Type":"application/json"
                    },
                    params:{
                        address:arg
                    }
                })
                .then(function (resp) { 
                    return resp.data; 
                });   
        }
    };   
}]);
</code></pre>

<p>I have used a similar code in the past and I never had an issue with it until now where my code editor is signaling this error in </p>

<blockquote>
  <p>line 6: Parsing Error: Unexpected token .</p>
</blockquote>

<p>Please tell me what i am doing wrong here. I am using <code>angular 1.5.8</code></p>