Created
September 12, 2017 10:01
-
-
Save AndreasDickow/cf621da28f368e9fe5c99d57c2efa7ba to your computer and use it in GitHub Desktop.
Ionic2 check if Component is already in Navigation Stack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
isAlready(name:string):number{ | |
if(name in this.viewcomponents) | |
{ | |
let comp = this.viewcomponents[name]; | |
let views = this.nav.getViews(); | |
return views.map(function(x) {return x.component; }).indexOf(comp); | |
} | |
return -1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment