In my HTML view, I have the following code:
<form name="adduser" id="signupForm" novalidate>
<span>First Name</span>
<label class="item item-input" id="profileLabel">
<input id="profileInput" type="text"
ng-model="user.fname"
class="form-control"
placeholder="{{fnamePlaceholder}}"
ng-minlength="1" >
</label>
<div id="name-group" class="form-group-lg">
<button type="submit" ng-click="updateData(user)" id="initiateSignUp" class=" button button-positive button-block" >
Save and continue
</button>
</div>
</form>
Below is the starting point of my controller:
$scope.updateData=function(user){
console.log (user.fname)
}
However, I am encountering the following error message:
TypeError: Cannot read property 'fname' of undefined