Phil 4.2.15

8:00 – 5:00 SR

  • Had to bounce the server
  • Status reports! Done.
  • Going to revisit the dynamic creation of callback functions to see if I can get it to work with Angular. If that fails I’m giving up and going back to interfaces. I expect Angular 2.0 to fix this problem anyway.
  • This works:
    export class ATSBase {
       constructor() {
          /****/
          this["timeoutFunction"] = () => {
             var proto:Object = this["__proto__"];
             proto["timeoutFunction"].apply(this, arguments);
          };
    
          this["myFunction"] = () => {
             var proto:Object = this["__proto__"];
             proto["myFunction"].apply(this, arguments);
          };
          console.log("done");
          /****/
       }
    }
  • This does not:
    class Base {
       constructor() {
          for (var p in this)
             if (!Object.prototype.hasOwnProperty.call(this, p) && typeof this[p] == 'function') {
                var method = this[p];
                this[p] = () => { method.apply(this, arguments); };
                // (make a prototype method bound to the instance)
             }
       }
    }
  • If I figure out that, I think I’ve got it…
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: