I am trying to enable the Google login button in SPA Angular.js 2.0 (typescript), but I don’t know what is the right way to implement Google callback in such a way that something works my Angular.
(or, alternatively, I wonder if it is correct to write a directive, but then how do I make a callback?)
Edit: adding source code
ngAfterViewInit() {
gapi.signin2.render(
"google-login-button",
{
"onSuccess": (user) => console.log(user),
"scope": "profile",
"theme": "dark",
"onfailure": function(err){console.log("error:"+err);}
});
console.log("afterview: gapi started");
}
Initialization seems to have gone fine. I see console.log and button. I can enter the popup, but after that the window closes and nothing happens. Nothing is printed on the console, either successful or error messages
source
share