How can I direct AngularJS to assimilate the value
attribute into the model? Any field that I give an ng-model
attribute has its value
immediately replaced with nothing, or whatever I define in the controller. Here's some code:
<form action="" method="post" ng-controller="PageCtrl">
<input type="text" name="title" ng-model="title" value="Initial field value">
</form>
And the Javascript...
function PageCtrl($scope, Slug) {
$scope.title = null;
}
I've tried not setting$scope.title
, setting it to other things, but no matter what I do, the value
is completely ignored. What can I do?