这是我的标记
<div id="username" ng-controller="quickUserAdd">
<h1>User</h1>
<input placeholder="your full name" ng-model="fullname">
<div ng-show="fullname">
<div>
<span class="big">Username</span>
<span class="small">{{username()}}</span>
</div>
<div class="password-{{passwordStatus()}}">
<input type="password" ng-model="password" placeholder="Password"/>
<span class="small">{{passwordStatus()}}</span>
</div>
</div>
</div>
我的控制器:
var passwordStrengths = ["weak", "medium", "ok", "great"];
function quickUserAdd($scope)
{
$scope.password = "";
$scope.fullname = "";
....
}
如何将 $scope.fullname、$scope.username 和 $scope.password 绑定到installation.user[0](其中安装是一个全局对象),以便在全名、用户名或密码发生任何更改时,它们都会被更新在installation.user[0] (也是一个对象)?