[windup-dev] TypeScript static data and inheritance
Ondrej Zizka
ozizka at redhat.com
Wed Oct 19 01:15:06 EDT 2016
Hi devs,
I am looking for a mechanism to have some static methods operating on
data which can be overriden.
U used to do it with an overriden static member, but it seems that
TypeScript got stricter and doesn't allow that anymore.
How would you implement that? Is there some singleton concept in
TypeScript?
Thanks, Ondra
|classA {staticfoo
=[-1];staticgetLastFoo(){returnA.foo[A.foo.length-1];}}classB extends A
{staticfoo =[1,2,3];// Did this work in TS 1.8?}B.getLastFoo();// <---
gives 3|
Ondra
--
--
Ondrej Zizka, Windup project, Brno
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/windup-dev/attachments/20161019/61cfd2c5/attachment-0001.html
More information about the windup-dev
mailing list