method missing - Can I get Ruby's method_missing behavior in typescript? -


if class not implement method, want handle error raised , inject own code, using method name.

for example:

class foo {     def method_missing(methodname) {         console.log(`${methodname} called`);     } }  let foo = new foo(); foo.bar(); // should print 'bar called' in console 

in ruby, there method called method_missing on every class provides behavior. can in typescript, , how?

no, typescript cannot this.


Comments

Popular posts from this blog

angular - DownloadURL return null in below code -

meteor - inserting data to database gives error "insert failed: Method '/texts/insert' not found" -