Aurelia is a great framework for a SPA, but one thing that is missing, I feel, is getting server-generated templates. By default, Aurelia uses the moduleId to fetch a static HTML file. Take this configuration: router.configure(config => {[ { route: [”,’Welcome’], moduleId: ‘./welcome’ }, { route: [‘About’], moduleId: ‘./about } ]); }); When you navigate to #About, two calls will be made: If your view is at some other location, you can customize the ConventionalViewStrategy.convertModuleIdToViewUrl function: ConventionalViewStrategy.convertModuleIdToViewUrl

Update This post is no longer up to date, as you can now bind to the files attribute of your input element: <input type=”file” files.bind=”files” /> This would bind to the files property of your viewmodel. This was the original post: I’m getting up to steam with Aurelia and really like it. One thing that is missing, though, is one-way databinding from view to viewmodel. There is a GitHub issue for it, so I suspect this will be included at

A small post for my own reference, and yours if you need it. It took me a while to get this working. In ASP.NET 5, the WebAPI Controller is no longer the same as the WebAPI 2 Controllers we’re used to. These Controllers are quite specific on how they accept content. Aurelia has an easy way of posting to a Controller: import {HttpClient} from ‘aurelia-http-client’ @inject(HttpClient) export class MyViewModel { constructor(http) { this.http = http; } callService() {‘http://some/url’, {

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