[RESOLVED][UI-SREF] doesnt work until another button is activated


I create a login page with 2 choices (FB and classic form):

<ion-view title="Login">
	<ion-content class="login" scroll="false">
		<div class="logoGoStretch" ui-sref="signin"></div>
		<div class="logoFB" ng-click="facebookLogin()" ></div>
		<div id="fb-root">

In app.js:


    .state('login', {
        url: "/login",
        templateUrl: "templates/login.html",
        controller: "LoginCtrl" 

    .state('signin', {
        url: "/signin",
        templateUrl: "templates/signin.html",
        controller: "LoginCtrl" 

Nothing is displayed when I click on ui-sref=“signin”, and also when I go directly to localhost:8100/#/signin

But the link works and form is displayed if I click on ng-click=“facebookLogin()”, come back to login page and click to ui-sref=“signin”

Please, I need help.

According to the doc, ui-sref is a directive that binds a link (<a> tag) to a state.

You’re using it on a div.

I changed to :

<a class="logoGoStretch" ui-sref="signin"></a>

But its the same

I forgot a little thing in my code :

if (toState.name !== "login" && toState.name !== "logout" && !$window.sessionStorage['fbtoken']) {

Of course it was impossible to go to sign-in page

Shame on me :smile: