Angularjs窗体范围错误

Angularjs窗体范围错误,angularjs,Angularjs,我有一个Angularjs表格,上面有一个名字列表。 当我点击一个名字时,表格会随着这里的个人资料而改变。 当我更改一个输入而不保存它,然后单击另一个配置文件时,除了一个已更改的输入之外,所有内容都会更改 <form class="form-horizontal bordered-row" > <div class="form-group"> <label class="col-sm-4 contr

我有一个Angularjs表格,上面有一个名字列表。 当我点击一个名字时,表格会随着这里的个人资料而改变。 当我更改一个输入而不保存它,然后单击另一个配置文件时,除了一个已更改的输入之外,所有内容都会更改

<form class="form-horizontal bordered-row" >
                <div class="form-group">
                  <label class="col-sm-4 control-label">Naam</label>
                  <div class="col-sm-6">
                    <input type="text" class="form-control" id="" value="{{gegevens.naam | capitalize}}">
                  </div>
                </div>
                <div class="form-group">
                  <label class="col-sm-4 control-label">Categorie</label>
                  <div class="col-sm-6">
                    <select class="form-control">
                      <option ng-repeat="x in producten_categorie" value="{{x.value}}" ng-selected="gegevens.categorie == x.value">{{x.name}}</option>
                    </select>
                  </div>
                </div>
                <div class="form-group pad25L">
                  <button class="btn btn-info" ng-click="productAlgemeen_update(gegevens.naam);">Save</button>
                </div>
              </form>

}

请注意,输入数据需要与ng模型绑定,而您输入的是值标记。这意味着该值是在html中而不是在模型中呈现的,因此当您单击其他概要文件时,UI无法检测到更改。请对输入框的输入值而不是值标记使用ng模型。

看起来变化检测是个问题。你能和我一起上课吗file@AniruddhaDas我是新来的,但是什么是ts类文件?当我按下de change scope时,一切都会改变,但除了一个已经改变,可能是因为它脏了?没关系,我认为它是角度应用程序,但它是angularjs。@AniruddhaDas Sorry你的意思是说当我们打开其他配置文件时,改变的值保持不变,没有反映正确的值?
$scope.productGegevens = function(product){
$http.post("php/producten-locatie.php", {'id':product.id}).then(function(response){
  $scope.producten_locatie = response.data.records[0];
  $scope.gegevens = {
    id:product.id,
    naam:product.naam,
    categorie:product.categorie,
    straatnaam:$scope.producten_locatie.straatnaam,
    huisnummer:$scope.producten_locatie.huisnummer,
    postcode:$scope.producten_locatie.postcode,
    stadsnaam:$scope.producten_locatie.stadsnaam
  };
});