Skip to content

Instantly share code, notes, and snippets.

@AndreasDickow
Created September 12, 2017 10:01
Show Gist options
  • Save AndreasDickow/cf621da28f368e9fe5c99d57c2efa7ba to your computer and use it in GitHub Desktop.
Save AndreasDickow/cf621da28f368e9fe5c99d57c2efa7ba to your computer and use it in GitHub Desktop.
Ionic2 check if Component is already in Navigation Stack
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