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

Type 'Timer' is not assignable to type 'number'. #25

Closed
be4code opened this issue Oct 22, 2015 · 16 comments
Closed

Type 'Timer' is not assignable to type 'number'. #25

be4code opened this issue Oct 22, 2015 · 16 comments
Labels

Comments

@be4code
Copy link

be4code commented Oct 22, 2015

I've got version 0.44.3:
ng2-bootstrap/components/carousel/carousel.ts(145,7): error TS2322: Type 'Timer' is not assignable to type 'number'.

@valorkin
Copy link
Member

yes, I have seen this thing, but it is not relevant to ng2-bootstrap,
some of typings defining setInterval return value type as Timer,
what is obviously wrong, and should be number
only question is: who provides broken type definition?

@valorkin
Copy link
Member

@be4code so what starter are you using?

@be4code
Copy link
Author

be4code commented Oct 26, 2015

I'm using https://github.com/mgechev/angular2-seed but they told me how to use ng2-bootstrap with the seed.

@valorkin
Copy link
Member

@ludohenin
Copy link

Maybe you can just force the type (<number>yourVar) where using it ?

@valorkin
Copy link
Member

published as 0.44.5
@ludohenin please try

@ludohenin
Copy link

@valorkin didn't fixed the compiler error. But this did: private currentInterval:NodeJS.Timer; (line 56 of carousel.ts)

@valorkin
Copy link
Member

but then all will have to install node tsd even if they use ng2-bootstrap from .net
do you have a branch where I can reproduce this issue?

@ludohenin
Copy link

Yeah I know and it's a problem ... here is the branch

@valorkin
Copy link
Member

@ludohenin fixed in 0.44.6, setInterval type doesn't worse to force ppl use tsd :)

@valorkin
Copy link
Member

please approve and I am closing this issue

@ludohenin
Copy link

Works like a charm :)
I think you can close that one.
Thanks.

@valorkin
Copy link
Member

Write to me if anything :)
can you create a gh-pages for your repo?
so I can include it ng2-bootstrap readme

@ludohenin
Copy link

I found this while roaming :). This how Timer issue is handled in ng2 source.
https://github.com/angular/angular/blob/master/modules/angular2/src/core/facade/async.ts#L10-L17

@valorkin
Copy link
Member

valorkin commented Nov 3, 2015

cool, looks good

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

No branches or pull requests

3 participants