Phil 2.26.15

7:30 – 3:30 SR, 3:30 – 4:30(?) All Hands

  • Snow. Working from home.
    • Getting TypeScript to work
    • Installing NodeJS
    • Installed node and “File Watchers” plugins
    • Settings->Languages and Frameworks->Node.js and NPM->Node interpreter: C:\Program Files\nodejs\node.exe.
    • Typescript now works, but I need to download definitelyTyped, for which I need Git – Installed.
    • Had to fix the THREE.Mesh d.ts to have the Material be MeshBasicMaterial, which is the default.
    • Compiled all the TypeScript files without errors or warnings. THe code is once more running. That only took 2 hours.
    • Shoveling snow break.
  • Creating a new folder ‘classes’ and moving the TypeScript modules to (CanvasClasses and ComponentClasses) that.
  • Going to try two ways of dealing with the canvas and data
    • Get a pointer to the WebGlCanvas passed to the controller, where WebGlComponent can be added and manipulated.
    • Done (a few times actually). I wound up passing the pointer to a callback function to the WebGlCanvas class that placed itself as the argument and then called the callback. That connects the loop in a nice, optional way. I then tried to have an addCube() method in the controller called, but controllers finish up after directives, I think. So now I’d like to have a way of having the controller call something when it’s ready. That would use the $scope.$on() code, but I’m using the controllerAs pattern , so no default scope. But thanks to this post, I found out how you get at it. Makes good sense too.
    • After looking and looking, I could not find a list of Angular creation events. Then I remembered from somewhere (need to find out where) that wrapping items that need to wait for completion can be done by using zero-length timeouts. Tried it out and it works:
private initCanvasCallback = (canvas:WebGlCanvasClasses.CanvasBase) => {
    var c:any = canvas;
    this.wglCanvas = canvas;
    this.myTimeoutService(this.addCube);
};
    • I’ll need the timeout function anyway for behaviors calculated in the controller, so it makes sense to have that.
    • And that’s a good day done. Tooltips next.