You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Support for static constructorsvar__extends=(Sub,Sup)=>{for(varpropinSup)if(Sup.hasOwnProperty(prop))Sub[prop]=Sup[prop]Sub.prototype=Object.create(Sup.prototype)Sub.prototype.constructor=Subif(Sub.initializer)Sub.initializer()};classComponent{staticall : Array<typeofComponent>=[]staticinitializer(){Component.all.push(this)}}classMyButtonextendsComponent{}classMyCheckboxextendsComponent{}classMyRadioextendsComponent{}console.assert(Component.all[0]===MyButton,'registration MyButton')console.assert(Component.all[1]===MyCheckbox,'registration MyChackbox')console.assert(Component.all[2]===MyRadio,'registration MyRadio')
Example:
This not works. But we have workaround:
But:
initializer
calls only on descendant classes.We can use decorators:
But:
The text was updated successfully, but these errors were encountered: