According to best practices I read about, in my controller, I assign a model to the $scope rather than assignging multiple separate values to $scope:
.controller('TestCtrl', function AboutCtrl($scope, $http) {
var model = {
name: 'Bob',
address: 'Squaresville'
}
};
$scope = model;
})
And in my template:
<input type="text" ng-model="model.name" /> {{model.name}}
<input type="text" ng-model="model.address" /> {{model.address}}
But when the page initially loads, the text boxes have no value. But as I type, the matching {{...}} tags get updated.
Why doesn't the initial value get updated?
model.in your markup