How do I put email in the login form?

Asked

Viewed 80 times

0

I made a web and mobile app. After the user’s registration, I am taking the email and saving it in the Torage locale. How can I place this email in the login form email field?

<ion-view title="Login" hide-back-button="true">
<ion-content overflow-scroll="true" padding="true" class="has-header">
    <form class="list">
        <ion-list>
            <div ng-controller="loginCtrl">
                <label class="item item-input">
                    <input type="text" ng-model="usuario.email" placeholder="E-mail">
                </label>
                <label class="item item-input">
                    <input type="password" ng-model="usuario.senha" placeholder="Senha">
                </label>
            </ion-list>
            <div class="spacer" style="height: 40px;"></div>
            <button class="button button-block button-positive" ng-click="logar(usuario)">Entrar</button>

            <a href="#/cadastroCep" class="button button-block button-positive">Cadastre-se</a>
            <div align="center">{{msgErro}}</div>
            </div>
    </form>
</ion-content>

  • Leaving the usuario.email ng-model is not working? And it is not showing any error in the console?

2 answers

1

I try something like this on your loginCtrl:

    .controller('loginCtrl', function($scope, $window) {
      $scope.usuario = {
        email: $window.localStorage['emailSalvo']
      };
    }
  • Right, but how I put the email in the login form, after picking up the email?

1


Browser other questions tagged

You are not signed in. Login or sign up in order to post.