Skip to content

Commit

Permalink
fix: add debounce to computeUrl to remove angular2 multiple api error
Browse files Browse the repository at this point in the history
  • Loading branch information
MrChoclate committed Aug 27, 2016
1 parent cc61087 commit 6314d67
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions google-maps-api.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,20 @@

/** @private */
libraryUrl: {
type: String,
computed: '_computeUrl(mapsUrl, version, apiKey, clientId, language, signedIn)'
type: String
}
},

observers: [
'_debounceComputeUrl(mapsUrl, version, apiKey, clientId, language, signedIn)'
],

_debounceComputeUrl: function(mapsUrl, version, apiKey, clientId, language, signedIn) {
this.debounce('_computeUrl', function () {
this.libraryUrl = this._computeUrl(mapsUrl, version, apiKey, clientId, language, signedIn);
}, 0);
},

_computeUrl: function(mapsUrl, version, apiKey, clientId, language, signedIn) {
var url = mapsUrl + '&v=' + version;

Expand Down

0 comments on commit 6314d67

Please sign in to comment.