Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customise countdown visualization #317

Open
Riccardo-Andreatta opened this issue Jun 9, 2017 · 2 comments
Open

Customise countdown visualization #317

Riccardo-Andreatta opened this issue Jun 9, 2017 · 2 comments

Comments

@Riccardo-Andreatta
Copy link

Riccardo-Andreatta commented Jun 9, 2017

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>
@siddii
Copy link
Owner

siddii commented Jun 9, 2017

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?

@Riccardo-Andreatta
Copy link
Author

Riccardo-Andreatta commented Jun 9, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants