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
fix #67
  • Loading branch information
MrChoclate committed Aug 26, 2016
1 parent cc61087 commit 01146e0
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions google-maps-api.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,21 @@

/** @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) {
var _this = this;
_this.debounce('_computeUrl', function () {
_this.libraryUrl = _this._computeUrl(_this.mapsUrl, _this.version, _this.apiKey, _this.clientId, _this.language, _this.signedIn);
}, 300);
},

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

Expand Down

0 comments on commit 01146e0

Please sign in to comment.