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 RequireJS JavaScript AMD from requirejs.org
Teaching JavaScript
Please visit my re-post of this article.I had the privilege of spending time with four interns at Omnitech this summer. See our @Omnitech Twitter feed to learn a little more about them. Sometimes it's difficult to know how to have interns at a company, but we see it as an investment in them, the community and ourselves. We've had several interns in the past become valuable employees. It's fun to see how much they grow personally and technically in just a few months or years. I didn't have the opportunity ......

Posted On Wednesday, August 24, 2016 2:35 PM

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

Mock RequireJS define dependencies with config.map
I had a module dependency, that I’m pulling down with RequireJS that I needed to use and write tests against. In this case, I don’t care about the actual implementation of the module (it’s simple enough that I’m just avoiding some AJAX calls). EDIT: make sure you look at the bottom example after the edit before using the config.map approach. I found that there is an easier way. I did not want to change the constructor of the consumer as I had a chain of changes that would have to be made and that ......

Posted On Monday, August 18, 2014 4:53 PM

Copyright © Aligned | Powered by: GeeksWithBlogs.net