Published 2017-02-26
Angular 2
Over the past six months I have been learning to use Angular 2 and reimplementing this website as a Single Page Application (SPA) written using that Javascript web framework.
The previous version of ahernp.com was implemented using the Django Python web framework. The application server is still implemented in Django.
This was mostly an exercise in writing a client-side Javascript application as doing that sort of work is a big part of my current job. Since 2010, I have mostly been coding using Python and Django.
Although my site is very simple, rewriting it in Javascript is a more complex task than the coding examples which appear in the literature.
As well as applying some design principals of my own (e.g. everything on the site is text apart from actual images), I have tried to go with the grain of the Angular 2 framework.
Almost all of the site content is text stored using the Markdown syntax.
When the site is initially loaded, the code and current page content is fetched and rendered immediately. The content of the rest of the pages is downloaded in the background. So clicking on an internal link within the site should result in an immediate response without querying the application server.
Clicking on an external link leaves the site (and SPA).
The source code for this site is available on Github (as is the Django version of the site here).