I'm trying to figure out how to get my user's email passed to my controller but I'm getting undefined for $scope.user.email. $scope is defined but there's no user object in there. Is there something wrong with my code?
html
<label class="item item-input">
<span class="input-label">Email</span>
<input ng-model="user.email" type="text">
</label>
<button ng-click="signInClick()" class="button button-full button-positive">
Sign In
</button>
controller
.controller('WelcomeCtrl', function($scope) {
$scope.signInClick = function() {
console.log($scope.user.email);
}
})
EDITS
The controller is linked via the js/apps.js and runs when my button is clicked so I know it's linked to WelcomeCtrl.
userobject anywhereuserobject"? Steve I added an edit for your question, sorry for the confusion.