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

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();

I’ve finished all my posts on ngEurope, so here’s a small recap. The conference itself was very decent, with some minor hiccups. Kudos to the organizers, and I hope to be able to attend it again. The sessions and speakers were very good, and it was really interesting (dare I say inspiring?) to see all the things that are happening in the Angular, javascript, and web world. Here is an overview of my posts, which is an overview of what

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

This session went into some of the patterns you see out there. A quick summary: Services: these are injected singletons. They’re an ideal place to cache application-level data, as a facade for the browser and third-party API’s, or factories for instantiating other objects. Databinding: this is just an implementation of the observer pattern. Inheritance for services & controllers: Standard prototypal inheritance can be used with services and controllers, but it’s recommended to avoid inheritance for page controllers. Thick models: for

At ngEurope, Marcy Sutton’s session on accessibility was one of the sessions I looked forward to most. Accessibility is something we often forget. While screenreaders and other tools are becoming increasingly sophisticated, so are our websites and applications. And it’s worth it to invest some time in accessibility, because everyone should be able to use the web. So here’s a quick recap of what was covered. Accessibility (or a11y, with 11 referring to the 11 omitted letters) starts with using

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

To really learn about the changes in Angular 2.0 Core, I recommend you watch the video of the presentation: Here are some things I noted: There is still HTML templating, but some ng- attributes have gone away. The following examples were given: <button (click)=”doSomething()”>Go</button><input [value]=”user.name”> I’m not sure what the difference is between the () and the [] though. Angular 2 will bind to properties of elements, not attributes. For example, a checkbox doesn’t have a checked attribute. It does,

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