Tuesday 15 March 2011

javascript - Typescript call function from base class -


There is a way to call a function from a base call overwritten.

Base Class

  Export Class Base Class {Constructor ({// Asynchronous // some calls started}}   

Inheritance class

  Export class InheritanceClass BaseClass extended {initialized () {// meet with base class}}    

Do you mean:

  class base {constructor ( ) {SetTimeout ((=) => {this.initialized ();}, 1000); } Initialized () {console.log ("Base initialized"); }} Class received base {initialized () {console.log ("initialized"); }} Var test: derived = new derivative (); // Console log works well in "initially received" - as expected   

(focus on weird red graphs on setTimeout () Do not give up, which I think is a bug - it compiles and runs fine.)

You need a method present on base , but you can call it Can be overridden in the derived (or in such a way, without calling ) Super Interlaced () ).

No comments:

Post a Comment