An astute observer has probably noticed that I’m using jQuery in my Angular2 example application. “The horror! Revoke his Angular2 license now!!” I’m in no way saying this is a best practice or even a good practice. Including jQuery is not required or even desirable for most Angular2 applications. Angular1 had a dependency on jQuery or its own jQuery-lite version, but for Angular2 this is no longer the case. jQuery will also cause problems for other scenarios, like pre-rendering the Angular2 application on the server or in a web worker, because jQuery components are expecting to work with the physical DOM. Plus it weights your application down with additional dependencies that will cause the application to load more slowly for a user. But using jQuery was practical for this situation and gives me the chance to demonstrate how Angular2 can interoperate with existing web technologies. Let’s take a step back and look why jQuery might be worth considering in certain scenarios. User Interface Widgets There’s been much discussion about creating general purpose user interface components (commonly called “widgets”). Think of widgets as resuable pieces of user interface that can help you to build your application, for example, a progress bar, Read More
In this article I will show how to use the ahead of time compiler (AOT) in Angular 2 to improve performance.
Take a look at the steps needed to set up a test-driven Angular 2 project with Webpack and TypeScript.
Recently I added Ahead-of-Time (AoT) compilation support to angular2-seed and received a lot of questions about it. In this post we’re going to explore in depth the Angular 2 AoT compilation. We will start from the beginning by answering the following questions:
Today we’re publishing Angular 2 RC5 – including:
- Support for @NgModule decorators
- FormsModule, RouterModule, and Material Design modules make it easier to use these libraries
- Ahead-of-time (AoT) compilation for components and services
- Lazy-loading support for the router
Angular Modules help organize an application into cohesive blocks of functionality.
An Angular Module class is adorned with the NgModule decorator that defines metadata about the module.
This chapter explains how to create
NgModuleclasses and how to load them, either immediately when the application launches or later, as needed, via the Router.
Source: Angular Modules (NgModule) – ts