Parse error: syntax error, unexpected token ";" in code example
Example 1: Parse error: syntax error, unexpected token "if"
Parse error: syntax error, unexpected token "if"
Example 2: parsing error unexpected token javascript
You have a misguided } character after the declaration of function1, just remove that character:
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;
});
}
}
}]);