Angular.js view doesn't update when nested $scope array is updated

笑着哭i 提交于 2019-11-29 03:50:43

Modify the code to wrap inside scope.$apply because you are modifying the property outside the angular scope you have to use scope.$apply() to watch the values

I had to place my form inside the same div controller as the ng-repeat. I had two separate div controllers.

Use $scope.$parent.arrayObjet to modify the parent variables instead of $scope.arryaObject. It worked in my case.

<div class="col-sm-12 col-lg-12">
            <div class="outer-container">
                <div class="inner-container">
                    <div class="table-header">
                        <form id="teamForm" name="teamForm">
                            <table class="table table-bordered">
                                <thead>

                                <!-- Grid header -->
                                <tbody data-ng-if="(allTeamMembers.length==0)">
                                    <tr>
                                        <td class="text-center height_33_p" colspan="15"> {{noResultFound}} </td>
                                    </tr>
                                </tbody>
                                <!-- Existing team member -->

                                <tbody data-ng-repeat="tm in teammemberDetailsArryobject|orderBy:orderByField:reverseSort" data-ng-form="innerForm_$index" data-ng-class="{'ng-submitted':innerForm_$index.$submitted}">
                                    <tr></tr>
                                    </tbody>

In the code I am deleting one record and add new row programmatically but all the rows are displayed in the ng-repeat rows(including deleted)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!