javascript - $scope element becomes "undefined" after being changed -
i have controller , object app.controller('maincontroller', function( $scope, $rootscope, $window, $state, $urlrouter, $http, content, flash, $modal, $stateparams ) { $scope.user = { username: '', password: '', email: 'default-value' } $scope.log = function ( message ) { console.log( message ) } ... and html this: <form class="form-inline form-waitlist" ng-show="showsignup"> <span class="form-group"> <input type="email" class="input-white form-control input-font-lg" ng-model="user.email" placeholder="email" /> <button class="btn btn-white btn-lg hidden-xs" ng-click="log( user.email )">sign {{ user.email }}</button> ... when load page field default-value , in object in controller. change typing in field, turns undefined. i'm in view, landing.splash , ...