Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

ionViewCanEnter no work #453

Open
ionitron-bot bot opened this issue Nov 29, 2018 · 0 comments
Open

ionViewCanEnter no work #453

ionitron-bot bot opened this issue Nov 29, 2018 · 0 comments
Labels

Comments

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 29, 2018

Original issue by @davidoween on 2018-03-17T18:47:58Z

Ionic version: (check one with "x")
[ ] 1.x (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1)
[ ] 2.x
[x ] 3.x

I'm submitting a ... (check one with "x")
[x ] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:
Before running the guard, load the page for a few moments

Expected behavior:
I should not load until I run guard.

Code:

async ionViewCanEnter(): Promise<any> {

    const token = await this.storage.get('token')

    if (token) {
      return true;
    }
    Observable.fromPromise(this.navCtrl.setRoot('LoginPage'));

  }

version of ionic is 3.2.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

0 participants