Geeks With Blogs

News Please visit me at my new blog!!

profile for Aligned at Stack Overflow, Q&A for professional and enthusiast programmers
"free in Christ Jesus from the law of sin and death." Romans 8:2 (ESV) Check out the Falling Plates video on YouTube.
more about the Gospel
And then listen to Francis Chan speaking at LifeLight in SD.

Programming and Learning from SD TypeScript www.typescript.lang
VS 2015 and Typescript module flag
Typescript 1.5 allows you to import modules using the import statement. import {DataService} from"../Modules/jQueryAjaxD... In Visual Studio 2015, the Build: Cannot compile modules unless the '--module' flag is provided stops me from proceeding. Here are the steps to take to user AMD module loading in VS 2015. Edit the TypeScript Build Module System options in the properties of the web project. Make sure to change it for debug and release. I found this answer on StackOverflow. Edit the project ......

Posted On Wednesday, September 2, 2015 9:00 PM

TypeScript and RequireJs
TypeScript and RequireJs work well together. Writing small modular code with Single Responsibilities (SOLID principles) is a good practice in any language and JavaScript is not an exception. AMD-Dependency Path Use amd-dependency path to include files you don’t need to use in code, but need to be loaded in order to run /// <amd-dependency path=”knockout-es5” /> Import Use import (translates to define([‘jquery’]) for adding in dependencies. Casing matters and must match the casing of the file ......

Posted On Friday, February 6, 2015 10:47 PM

Order matters with AMD-Dependency, TypeScript and use strict
I found this out the hard way the other day. We’re using TypeScript and RequireJS for development. There’s a nice way to ensure the file has a dependency, without having to import it. Put the comment at the top of you file. /// <amd-dependency path="knockout-es5"/> I found that this needs to be at the very top or Require won’t pull in the file. I unsuspectingly added “use strict”; and it stopped working. After awhile, we moved it below and it worked. Invalid: “use strict”; /// <amd-dependency ......

Posted On Friday, January 30, 2015 3:45 PM

TypeScript Import casing matters
I have a TypeScript class with PascalCasing, but the file name was camelCasing.ts (to match our other existing js files) and my TypeScript wouldn’t complied in our Gated Check-in build. It turns out that this is converted to a RequireJs define call, which looks at the filename, not the class name. That took awhile and help from team members to figure out. I hope you can avoid losing time like I did. Here’s a quick example: // my Typescript model, file name is webCam.ts class WebCam { id: string; ......

Posted On Tuesday, October 28, 2014 8:26 PM

Referencing files TypeScript 0.9
I was trying to reference an existing JavaScript file from my new TypeScript file using /// <reference path="app.js"/> It wasn’t being found, until I found that you need to have the file saved as UTF-8. To do this in Visual Studio 2012 on Windows 7, click on file –> save as –> then click on the down arrow of the save button and choose save with encoding. TypeScript then found my JavaScript and started parsing. Now I have a lot of errors when I build the solution (other references aren’t ......

Posted On Friday, July 12, 2013 11:51 AM

Copyright © Aligned | Powered by: