Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
theuser485150dJust compare the objects. Classes are just a contrived way to create prototype-linked objects. Don't treat TS or JS as class oriented because they are not. If you are stonewalling, then it wasn't designed that way.
thatsnotnice64349dcomponents typed against an interface + component factory that does the magic a emit the correct implementation. in templates you instanciate only the factory then.
it’s a workaround but it doest the job. finally it’s a classic strategy pattern.
otherwise, components are able to figure out the generic type on @Input, you generic logic can be implemented starting from here. class declaration can stit happily untyped.
unfortunately angular needs to stick with this class-ish approach, otherwise ex-javaers feel lost going for what TS actually is, functional with structural type system rather then classic OOP + nominal types 😂