我想在我的AngularJS应用程序中使用OAuth,为此,我需要将用户带到Twitter OAuth页面,以便他们可以授予访问权限。我可以在我的应用程序中做到这一点,但我不希望将用户重定向到Angular应用程序的上下文之外(即不重新加载页面),所以我想要做的是在弹出窗口或模式窗口中打开授权页面。用户在该窗口中完成工作流,当他们关闭模式时,访问令牌存储在我的应用程序中或cookie中。
我真的很难弄清楚如何打开这个弹出窗口,并用Twitter授权页面填充它。
> Here is an example: http://plnkr.co/edit/NeMAj32daePMopWaffkw?
在从组件执行提交操作后,我尝试显示一个模式确认弹出窗口。
我的home.component.ts中的onSubmit()方法:
onSubmit() {
var response = new Response(1, this.name, this.phone, this.email,
this.optIn, this.responses);
this.questionsService.saveResponse(response).subscribe(
data => response = data)
// show popup con