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.
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.
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.
Today, at work, I spent quite a long time on figuring out, how to handle file upload, image to be exact, from angular2 app to backend in ASP.NET Core. I thought it’s a good idea for a post - maybe it will save you some time.