B
B
borgez2015-07-17 12:14:41
Angular
borgez, 2015-07-17 12:14:41

How to reset template to initial state for ng-repeat string?

There is a pattern

<tr ng-repeat="i in Data | filter:search | filter:global_search | orderBy:order track by i.Id">
<button><i class=" fa fa-search"></i></button>

...
when clicking on the button
$this
                    .prop('disabled', true)
                    .html('<i class="fa fa-spinner fa-pulse"></i>')
                    .load(target, { Id: id }, function (response, status, xhr) {
                            $this.html('<i class="fa fa-check"></i>');
                    });

On an event, after a while, the Data is updated, but <button><i class="fa fa-check"></i></button>remains.
Everything works without track by i.Id, but as I understand it, there will be performance problems

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RodgerFox, 2015-07-18
@RodgerFox

From what data is updated? Is it just a period of time or is something changing somewhere? how about ng-hide/show and attach to them what changes

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question