Can you help me figure out why the $scope.data
variable is not updating when I input valid values in the form fields? How can I solve this issue?
Check out the code example on Codepen: http://codepen.io/uloco/pen/jboorN
HTML
<div ng-app="app" ng-controller="AppController" class="content">
<input type="tel" ng-model="form.phone" placeholder="phone" />
<input type="email" ng-model="form.email" placeholder="email" />
<p>{{form}}</p>
<p>{{data}}</p>
</div>
JS
angular
.module('app', [])
.controller('AppController', function($scope) {
$scope.form = {};
$scope.data = {
foo: 'bar',
phone: $scope.form.phone,
email: $scope.form.email
}
});