How to put email in the login form?

0

I made a web and mobile application. After registering the user, I am picking up the email and saving it in the localStorage. How can I put this email in the email form of the login form?

<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>

    
asked by anonymous 16.03.2016 / 15:54

2 answers

1

As Parazito Responded:

.controller('loginCtrl', function($scope){
    // define no email [email protected]
    $scope.usuario = {
    "email":"[email protected]"
    }
    
16.03.2016 / 18:55
1

I try something like this on your loginCtrl :

    .controller('loginCtrl', function($scope, $window) {
      $scope.usuario = {
        email: $window.localStorage['emailSalvo']
      };
    }
    
16.03.2016 / 16:50