pandas2014-11-08 16:24:40
pandas, 2014-11-08 16:24:40

Angular.JS: What is the correct way to change an object property from a list of objects?

Friends, who can come across.
There is a list of objects. The "home" page is the list itself.
There is a page for adding a new object - a standard html form, where scope is a form. There is also an object editing page, where scope is also a form.
There is a property of the object - visibility. In the add and edit forms, I implemented the work with this property through the radio input block, where the value (true or false) comes to the angular scope through binding.
But on the "main" page with a list of objects, I cannot correctly implement work with this object property through angular, because there, the view is built with the ng-repeat="object in objects" directive, so I can't directly bind to this property of a particular object via $scope.item.visibility.
Therefore, I had to implement this idea through jquery, where the property changes according to the DOM element. But this is completely unacceptable, although it works perfectly. It is unacceptable - obviously because Angular does not work with the house, but with objects, and interfering with the code in this way is a terrible India and shit code.
Questions, comments, wishes, suggestions?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question