Set Strtaing page of app


#1

I have to set starting page of my app…when client is already registered…that time I check its record in my database that time my app will start from login.html…otherwise it will starts from index.html

But I have no idea for do that…So Somebody help me please…


#2

You have to understand how Angular UI Router works. You can also take a look at tabs template provided by ionic which has the same concept.


#3

@shivani8710

You need a make a condition to know which route you need to go, i wrote this in the .run of the application

My example:

if (BD.get() === null) {
      $state.go('login')
} else {
      $state.go('home')
}

BD.get() give me a "tokenSession", but this is my implementation

you need inject $state, i guess that is not the best way, but its works
PS: you need erase $urlRouterProvider.otherwise(’/login’) of .config, because the “login” appears a few moment before to go “home”.