Loading JSON files in Angular 2

I have been using the Angular 2 Webpack Starter on github as a base for my Angular 2 applications. In order to deploy your Angular 2 application we need to package it for production by running the following command

This bundles the app up and creates a dist directory where the app will be…

Angular 2 Keyboard Events

Angular 2 allows us to listen to keyboard events by using the @HostListener decorator. The @HostListener decorator allows us to listen to events that are emitted by an element. In other words, @HostListener allows us to bind to an element and react to specific events. Lets use the @HostListener decorator to listen to keyboard events…

The Beauty of Vue.js

After using ReactJS/Angular/Angular 2, it’s not hard to get locked in to the frameworks way of doing things. Although less true with ReactJS, Angular (especially Angular 2) makes it difficult to use anything non-angular into your app. When working with legacy/enterprise applications this is even more true. There are times when you are trying to…

Angular 2 Output Properties

Outputs The Output decorator allows components to raise custom events and notify consumers of a change in state. To accomplish this in Angular 2, we rely on an EventEmmitter to publish the event. In our previous example, our FavoriteComponent allowed us to favorite/unfavorite. This worked well for an example, but wasn’t practical. In a real-world…

Angular 2 Decorators

In Angular 2, decorators allow you to add metadata to a class using annotations. The most common decorators are the @Component and @Injectable. Decorators add metadata to a class in order to give it meaning; they are a declarative way to add metadata to code Let’s take a look at the class below.

This…