标签: angularjs angular-components angular1.6
I have search list where a user can click on an item. The item gets added to a list. The list is a component in my app. The list component includes an input section where the user can input a price they want to set for that specific list item. When I type in a price for a specific list item, the inputs for the other items get updated with the same price. Click this to see an example.
答案 0 :(得分:0)
即使我看不到代码,我也觉得这是因为你将相同的$ scope变量附加到你正在改变的所有ng-model上,这会改变每个实例那个输入框。通过删除$scope,您可以将其作为列表项的该实例的局部变量,我假设您正在使用ng-repeat吗?
$scope
ng-repeat
将$scope.someVarName更改为someVarName并查看是否可以解决此问题。
$scope.someVarName
someVarName