Skip to content

Commit 01146e0

Browse files
committed
fix: add debounce to computeUrl to remove angular2 multiple api error
fix GoogleWebComponents#67
1 parent cc61087 commit 01146e0

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

google-maps-api.html

+12-2
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,21 @@
103103

104104
/** @private */
105105
libraryUrl: {
106-
type: String,
107-
computed: '_computeUrl(mapsUrl, version, apiKey, clientId, language, signedIn)'
106+
type: String
108107
}
109108
},
110109

110+
observers: [
111+
'_debounceComputeUrl(mapsUrl, version, apiKey, clientId, language, signedIn)'
112+
],
113+
114+
_debounceComputeUrl: function(mapsUrl, version, apiKey, clientId, language, signedIn) {
115+
var _this = this;
116+
_this.debounce('_computeUrl', function () {
117+
_this.libraryUrl = _this._computeUrl(_this.mapsUrl, _this.version, _this.apiKey, _this.clientId, _this.language, _this.signedIn);
118+
}, 300);
119+
},
120+
111121
_computeUrl: function(mapsUrl, version, apiKey, clientId, language, signedIn) {
112122
var url = mapsUrl + '&v=' + version;
113123

0 commit comments

Comments
 (0)