angular-timer icon indicating copy to clipboard operation
angular-timer copied to clipboard

Customise countdown visualization

Open Riccardo-Andreatta opened this issue 8 years ago • 2 comments
trafficstars

Is there the option to have a custom visualisation of the count down? For example, I have something like the following

<timer countdown="10041" max-time-unit="'minute'" interval="1000">{{days}} day{{daysS}}, {{hours}} hour{{hoursS}}, {{minutes}} minute{{minutesS}}</timer>

I would like that when there are no more days left, they disappear, and also the when there are no more hours left, and when there are no more minutes the seconds are shown.

I have tried to put them in a sort of ng-if statement but this solution does not work, so maybe I am doing something wrong?

<div ng-if="w">
    <timer countdown="10041" max-time-unit="'minute'" interval="1000">{{days}} day{{daysS}}, {{hours}} hour{{hoursS}}, {{minutes}} minute{{minutesS}}</timer>
</div>

<div ng-if="x">
    <timer countdown="10041" max-time-unit="'minute'" interval="1000">{{hours}} hour{{hoursS}}, {{minutes}} minute{{minutesS}}</timer>
</div>

<div ng-if="y">
    <timer countdown="10041" max-time-unit="'minute'" interval="1000">{{minutes}} minute{{minutesS}}</timer>
</div>

<div ng-if="z">
    <timer countdown="10041" max-time-unit="'second'" interval="1000">{{sseconds}} second{{secondsS}}</timer>
</div>

Riccardo-Andreatta avatar Jun 09 '17 08:06 Riccardo-Andreatta

I think you might be running into a issue of multiple timer on the same page. Possibly scope collisions?

Can you try it without ng-if?

siddii avatar Jun 09 '17 16:06 siddii

How can I achieve what I want without a ng-if? Is there any options to do that?

Riccardo-Andreatta avatar Jun 09 '17 17:06 Riccardo-Andreatta