Skip to content

Commit 5955cce

Browse files
committed
Merge pull request #23 from crhym3/root-attr
Add root attribute to google-api-loader
2 parents 1ad3427 + 2e7a748 commit 5955cce

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

google-client-api.html

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
@homepage http://polymerlabs.github.io/google-apis
5656
-->
5757
<polymer-element name="google-api-loader"
58-
attributes="name version appId"
58+
attributes="name version appId root"
5959
extends="google-client-api"
6060
on-api-load="{{doneLoadingClient}}">
6161
<script>
@@ -107,6 +107,17 @@
107107
* @attribute appId
108108
* @type string
109109
*/
110+
appId: null,
111+
112+
/**
113+
* Root URL where to load the API from, e.g. 'http://host/apis'.
114+
* For App Engine dev server this would be something like:
115+
* 'http://localhost:8080/_ah/api'.
116+
* Overrides 'appId' if both are specified.
117+
* @attribute root
118+
* @type string
119+
*/
120+
root: null,
110121

111122
// Used to fix events potentially being fired multiple times by
112123
// core-shared-lib.
@@ -194,7 +205,9 @@
194205
// Otherwise, looks like we're loading a new API.
195206
} else {
196207
var root;
197-
if (this.appId) {
208+
if (this.root) {
209+
root = this.root
210+
} else if (this.appId) {
198211
root = 'https://' + this.appId + '.appspot.com/_ah/api';
199212
}
200213
statuses_[this.name] = 'loading';

0 commit comments

Comments
 (0)