A
A
Alexander Ivanov2019-05-15 09:56:34
Angular
Alexander Ivanov, 2019-05-15 09:56:34

How to make a function called 1 time in angular like regular JS?

when I call this function, it always adds one and gets a growing number, although it was called only once.

count(){
    return this.idLocalFiles++;
  }

I want to call it and have it count once and add one each time it is called.
{{count()}} // 0
{{count()}} // 1
{{count()}} // 2
{{count()}} // 3

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