I am a beginner in angularjs. Now I have encountered such a problem in the project. In angularjs, ng-repeat loops through a form, the ng-model content of the same name is used in multiple forms generated. Changing the content based on angular's two-way data binding will update all content...
I am a beginner in angularjs. Now I have encountered such a problem in the project. In angularjs, ng-repeat loops through a form, the ng-model content of the same name is used in multiple forms. If you change the content of an angular two-way data binding, all content is updated, I want to know if there is any good solution. Thank you for your answers.
Loop code
This is the result after the input.
Reply content:
I am a beginner in angularjs. Now I have encountered such a problem in the project. In angularjs, ng-repeat loops through a form, the ng-model content of the same name is used in multiple forms. If you change the content of an angular two-way data binding, all content is updated, I want to know if there is any good solution. Thank you for your answers.
Loop code
This is the result after the input.
Texeure is under the global scope, and repeat has its own scope, which "inherits" the global scope.
The input model should use the valid variables of scope in repeat.
You can write
{Item. value }:{{ item. price }}
No,ng-repeatGenerates$$hashKeyWill locate each array, so changing one won't update all