mercredi 1 juillet 2015

Angularjs Form input text is always undefined

Here is my form

<form>
<input class="text_box1" type="text" name="email" ng-model="forget.email" >
<button style="width:auto" class="sign_up" ng-click="doForget(forget)">Get a Password</button>
</form>

Inside my app.js I have

.when('/forget', {
                title: 'forget',
                templateUrl: 'resources/views/forget.php',
                controller: 'authCtrl'
            })

And inside the authCtrl controller i tried to do the console of the input value.

$scope.doForget = function (customer) {
        console.log($scope.email);
    };

But i am getting the console as undefined always.

How can i get this value ?

Aucun commentaire:

Enregistrer un commentaire