You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.
app.run(function(GApi){// Load Google Translate Client LibraryGApi.load('translate','v2');});app.controller('FooCtrl',function(GApi){varparams={};GApi.execute('translate','detections.list',params).then(function(result){// ...});});
The issue is that the Translate API is available as language under window.gapi.client and not as translate. The call to execute() method results in an error since the following is tried:
whereas $window.gapi.client['translate'] results to undefined.
My workaround has been as follows:
app.run(function(GApi,$window){// Load Google Translate Client LibraryGApi.load('translate','v2').then(function(result){// the API has been loaded successfully$window.gapi.client.translate=$window.gapi.client.language;});});
This works nicely, but the library should take care of this case and not the client. I can start a PR on this if needed!?
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The following does not work:
The issue is that the Translate API is available as
language
underwindow.gapi.client
and not astranslate
. The call toexecute()
method results in an error since the following is tried:whereas
$window.gapi.client['translate']
results toundefined
.My workaround has been as follows:
This works nicely, but the library should take care of this case and not the client. I can start a PR on this if needed!?
The text was updated successfully, but these errors were encountered: