Is there a way to create a global variable in ionic2 and use in all components with out importing in every component.
No. Your best option is to define a provider that exposes this property and inject it where needed.
ok,I will try Thank you
This works when the service property is set in app.component, and I then go to a page via (ViewChild)nav.setRoot. However, when I go to the page via this.rootPage, the service is empty; not only is the property not set, the property doesnt exist.
The provider is referenced in app.module, app.component, and the page Ive redirected to (such as HomePage).
Any help greatly appreciated.