Aurelia is Rob Eisenberg’s new framework for SPA’s (single page applications), and I wanted to set it up in combination with ASP.NET. I’m a fan of Angular, but I’ve been watching Aurelia closely too. Angular has a large following, which I find very important, because it guarantees you will have quick and easy support when you encounter a problem. But I dabbled with Durandal and like Rob Eisenberg’s approach. It feels like there has gone a little more thought into

After having moved all my posts from Blogger to Ghost, I was left with the problem that Blogger doesn’t allow for 301 redirects. Granted, I don’t think I have that many incoming links out in the wild, but as a former SEO-guy, I wanted to do things right. Unfortunately, Blogger doesn’t allow me to do things right (I need access to .htaccess). So the next best thing I could think of, was displaying a user-friendly message, redirecting users to my

When you have an older javascript library that supports asynchronous calls via callbacks, you might want to wrap them in a promise instead. Particularly if you’re using Angular. For my own reference, this is how to do it. I’m using Angular’s $q, but I suspect it should be more or less the same with Q. Let’s assume this is the method with the callbacks: function goAsync(input, success, error) { try { // do something here success(result); } catch { error();

If you’ve dabbled with AngularJS, it’s very likely you’ve encountered $q. At ngEurope, there was a session devoted to $q, which gave a good overview of what it can do. The ‘old way’ of doing asynchronous programming in javascript, is to use callbacks. But when your application becomes more complex, this leads to nested callbacks, which are ugly, unreadable, hard to maintain,… But they’re also not parallelizable, composable or dynamic. With $q, you can stop the callback-madness. Instead of passing

In my series of posts on ngEurope, I’ve covered quite a bit by now. It’s testament to the volume covered at ngEurope. There are some smaller things I’ll cover in this one post. This doesn’t mean they are less significant. Just that they resonated less with me, but they are interesting enough to mention. After this one, there are still some posts coming where I focus on a single subject. At the end, I’ll post an overview of everything I

The second day of ngEurope started with… the keynote. A bit strange, but whatever. Misko Hevery gave a good explanation of the future of javascript, and how it’s coming to us early with AtScript. First, he stressed they were not building a new language. But the fact is that the current state of javascript makes it hard to develop complex applications and frameworks (hence the invention of TypeScript). Misko gave the specific example of a complex directive (check out this

One of the most impressive sessions at ngEurope was Matthieu Lux programming Angular from scratch. He **literally **started with an empty html file and coded in the javascript for databinding. His full demo can be seen on YouTube and is very much worth looking at. It will help you understand the ‘magic’ behind Angular (even though Angular is more than just databinding). You can also look at the source on GitHub. Simply said, Angular keeps a list of watchers that

Rob Eisenberg was at ngEurope to talk about Angular’s new router. Rob is the author of Durandal and has recently been added to the Angular team. Together, they took a good look at the different routers out there (SammyJS, EmberJS, Durandal,…). They used what worked and improved what didn’t to create a new router for Angular 2.0. What’s cool is that they backported it to Angular 1.3. So you can already start using it. Basic features are what you would

At ngEurope, Julie Ralph and Chirayu Krishnappa gave an interesting presentation on Protractor. Protractor is a framework for end-to-end testing. The goal was not unit testing, because unit testing won’t catch everything. Like so many of the projects in the Angular and javascript space, it is heavily under development, but the 1.0 release is planned for July 2015. Protractor is implemented in NodeJS so you can write your tests in javascript. The most common way to run them is to

Angular 1.3 provides us with some improvements over an already very decent framework. At ngEurope, the sessions were fast and intensive, which was an interesting approach, but also didn’t allow for very many details. That being said, here are the points I noted. $compileProvider.debugInfoEnabled(false); This allows you to disable all the debugging info for the code you will deploy in production. Read more about it in the docs. $httpProvider.useApplyAsync(true) Normally, returning from an HTTP call will trigger Angular’s $apply function.