I am facing an issue with retrieving the value of email in my controller. It always returns 'undefined'.
Here is my form:
<form role="form" novalidate>
<div class="form-group">
<input type="email" ng-model="user.email" name="email" id="email" class="form-control input-sm" placeholder="Email Address" formnovalidate>
</div>
<input type="submit" ng-click="submit()" value="Register" class="btn btn-info btn-block">
</form>
And here is my controller:
app.controller('RegistrationController', function ($scope) {
$scope.user = {};
$scope.submit = function() {
alert($scope.user.email);
alert(this.user.email);
};
});