ng-repeat используется для отображения данных, когда данные обновляются с помощью кнопки сохранения, как мне обновить ng-repeat без обновления всей страницы? - PullRequest
0 голосов
/ 03 июля 2018

Это div, содержащий HTML-код со списком:

 <div id="searchResults" class="container-fluid">

                <table ng-show="HasMyData()" class="table table-striped table-condensed table-hover">
                    <thead>
                        <tr>
                            <th class="text-center smalltext bold">Version</th>
                            <th class="text-center smalltext bold">City</th>
                            <th class="smalltext bold">Description</th>
                            <th class="text-center smalltext bold">Food</th>
                            <th class="text-center smalltext bold">Lizard</th>
                            <th class="text-center smalltext bold">Lost</th>

                            <th class="text-center smalltext bold">Complete</th>
                            <th class="text-center smalltext bold">Active</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr style="cursor:pointer;" ng-class="{ selectedrow: isSelectedReg($id) }" ng-click="GetDetails(data,$id)" ng-show="numberOfRecords != 0"
                            ng-repeat="data in myData | 
                            filter:{'name':FilterByDescription(search.val)} |
                            filter:{'isFood':FilterIsFood} |
                            filter:{'isLizard':FilterIsLizard} |
                            filter:{'isLost':FilterIsLost} |
                            filter:{'reviewCompleted':FilterByComplete()} | 
                            filter:{'activeInd':FilterByInactive() }">
                            <td class="text-center smalltext">{{data.versionNumber}}</td>
                            <td class="text-center smalltext">{{data.cityName}}</td>
                            <td class="smalltext">{{data.name}}</td>
                            <td class="text-center"><input type="checkbox" ng-checked="data.isFood" disabled></td>
                            <td class="text-center"><input type="checkbox" ng-checked="data.isLizard" disabled></td>
                            <td class="text-center"><input type="checkbox" ng-checked="data.isLost" disabled></td>
                            <td class="text-center"><input type="checkbox" ng-checked="data.reviewCompleted" disabled></td>
                            <td class="text-center"><input type="checkbox" ng-checked="data.activeInd" disabled></td>
                        </tr>
                        <tr ng-show="numberOfRecords == 0">
                            <td colspan="5">NO RECORDS FOUND</td>
                        </tr>
                    </tbody>
                </table>
            </div>

Данные обновляются с помощью формы, а затем вышеупомянутое div / ng-repeat должно быть перезагружено после обновления. Я прочитал несколько сообщений, в которых говорится, что это должно быть автоматически ... но это не происходит.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...