1

How to alert the timer value by using the AngularJS? Here is the code I used for the timer tag:

<timer interval="1000" countdown="100">{{countdown}}</timer> 

Also here is the alert function I used in script.js file for the alert of the timer, but it is showing undefined.

Here is my Plunker.

halfer
  • 19,824
  • 17
  • 99
  • 186
Ramana Uday
  • 355
  • 2
  • 6
  • 21

1 Answers1

1

Unfortunately the timer is designed to be a self contained module, there is no direct way to request the current time from the directive.

Luckily for each tick it triggers an event broadcasting the remaining time, we can make use of that.

Please refer to https://stackoverflow.com/a/26951475/5039495 on how to do this.

Community
  • 1
  • 1
Icycool
  • 7,099
  • 1
  • 25
  • 33