Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有搜索列表,用户可以在其中单击某个项目。该项目被添加到列表中。该列表是我的应用程序中的一个组件。列表组件包括一个输入部分,用户可以在其中输入他们想要为该特定列表项设置的价格。当我为特定列表项输入价格时,其他项目的输入会更新为相同的价格。单击此处查看示例。
尽管我看不到代码,但我有一种感觉,这是因为您将相同的 $scope 变量附加到您正在更改的所有 ng-models 上,这将更改该输入框的每个实例。通过删除$scope,您将使其成为我假设您正在使用的列表项实例的局部变量ng-repeat?
$scope
ng-repeat
更改$scope.someVarName并someVarName查看是否可以修复它。
$scope.someVarName
someVarName