Angular2 modules

Angular2 modules

Angular2 introduces the concept of Modules (NgModule). Every angular2 application need to have at least one module, conventionally named AppModule. As the name suggests, module groups a part (or a whole) of application into a unit, which is easier to maintain. In this post I would like to show you, how modules work, how to split your application into modules and how to add a shared module with common components.

read more

How to extend an Angular2 pipe

How to extend an Angular2 pipe

Angular2 comes with some predefined pipes. For those of you, who don’t know, pipe is a tool, which allows you to modify output of a property in the template. For example, to format date, price etc. Today, at work I had to come up with a solution, which would allow me to have a DatePipe, which format is configured in the application settings - based on a currently selected translation. I could write a new, custom DatePipe, but why should I invent a wheel. I decided to extend the DatePipe, which is coming with the angular and change its behaviour to suit my needs. It wasn’t as straight forward as I thought it would be, so I am writing this post in case someone else has the same idea.

read more

Testing in Angular2

Testing in Angular2

In this post, I will show you how to test Angular2 application using Karma runner and Jasmine framework. You will learn how to setup the environment, configure dependencies in TestBed and test your services and components.

read more

ASP.NET Core with Angular2 - tutorial

ASP.NET Core with Angular2 - tutorial

In this tutorial, I would like to show you, how to set up an application using ASP.NET Core as an API for Angular2 frontend. You will read about Startup class in the new ASP, setting up Angular2 dependencies with NPM, configuring SystemJS, Angular2 components and services and how to connect it all together.

The whole project, which you can use as a template, can be found on GitHub.

read more