小编Fer*_*lmo的帖子

没有NavController的提供者

我从sidemenu起动器开始使用离子2应用程序.现在我想将生成的代码组件(菜单)中的代码移动到一个文件夹中,然后编写一个home组件.当我运行应用程序时,它显示我的错误:

原始异常:没有NavController的提供者!

我的app.component的代码是:

import { Component } from '@angular/core';
import { NavController, Platform } from 'ionic-angular';
import { StatusBar } from 'ionic-native';

import { Login } from '../pages/login/login';

@Component({
  templateUrl: 'app.html'
})
export class MyApp {

  nav: NavController;

  constructor(public platform: Platform, nav: NavController) {
    this.nav = nav;
    this.initializeApp();
  }

  initializeApp() {
    this.platform.ready().then(() => {
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.
      StatusBar.styleDefault(); …
Run Code Online (Sandbox Code Playgroud)

navigation ionic2 angular

8
推荐指数
2
解决办法
9139
查看次数

登录后Angularfire2重定向

我正在使用 ionic 2 rc0 和 angular 2,我刚刚添加了 angularfire2 以使用 firebse auth。

我已经完成所有配置和测试(我只看到我的用户登录了 firebase 控制台),但我想在登录后重定向到其他页面。

我的登录代码:

registerUserWithGoogle() {
   console.log('Google');
   this.af.auth.login();
}
Run Code Online (Sandbox Code Playgroud)

我的 Firebase 配置是:

export const myFirebaseAuthConfig = {
   provider: AuthProviders.Google,
   method: AuthMethods.Redirect
};
Run Code Online (Sandbox Code Playgroud)

那么有没有办法在方法 login() 之后重定向?

firebase firebase-authentication ionic2 angularfire2 angular

2
推荐指数
1
解决办法
3949
查看次数