0

I am a designer and don't have much knowledge about scripting. I have a jQuery function which display number counter. I want to use this with angular model. I tried applying class in this way but it shows NAN error.

I Tried:

<td><span class="count">{{model.Conversion.Total}}</span></td>

Output:

NAN Error

Angular Code:

 <td class="widthCustomtd">Total Invoices</td>
 <td>{{model.Conversion.Total}}</td>

Jquery Code:

<!-- 1 to 100 Counter Class -->
<span class="count">100</span>

<!-- Function -->
$('.count').each(function () {
    $(this).prop('Counter',0).animate({
        Counter: $(this).text()
    }, {
        duration: 4000,
        easing: 'swing',
        step: function (now) {
            $(this).text(Math.ceil(now));
        }
    });
});
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
  • AngularJS modifies the normal JavaScript flow by providing its own event processing loop. This splits the JavaScript into classical and AngularJS execution context. Only operations which are applied in the AngularJS execution context will benefit from AngularJS data-binding, exception handling, property watching, etc. – georgeawg Mar 17 '18 at 15:46
  • Any help in terms of technical implementation ? – Harsh Bhardwaj Mar 18 '18 at 03:20
  • Read [“Thinking in AngularJS” if I have a jQuery background.](https://stackoverflow.com/questions/14994391/thinking-in-angularjs-if-i-have-a-jquery-background). – georgeawg Mar 18 '18 at 06:20

0 Answers0