angularjs6说去表单的双向绑定
<form #myForm = "ngForm">
<div class="form-group row">
<label class="col-sm-2 col-form-label"> </label>
<div class="col-sm-10">
<h1>登陆</h1>
</div>
</div>
<div class="form-group row">
<label for="inputPassword" class="col-sm-2 col-form-label">userName</label>
<div class="col-sm-10">
<input [(ngModel)]="user.username" name="username" class="form-control" id="username" placeholder="userName">
</div>
</div>
<div class="form-group row">
<label for="inputPassword" class="col-sm-2 col-form-label">Password</label>
<div class="col-sm-10">
<input type="password" [(ngModel)]="user.username" name="password" class="form-control" id="password" placeholder="Password">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label"> </label>
<div class="col-sm-10">
<button type="submit" (click)=" save(myForm.value)" class="btn btn-primary mb-2 form-control">提交</button>
</div>
</div>