Angular2 Components Introduction


Components are the core of Angular 2, and replace the delicate mess of Controllers, Scopes, and Directives as we knew them in version 1. It is very different from version 1 and it s recommended not to study version 1 and then move to version 2 hoping to easily and quickly understand version 2 because that would not happen.

If you’ve ever written Java, C#, or any other language with strong OO patterns, you’ll immediately understand a component. It’s just a class that represents an element on the screen, with member-data that influences the way it looks and behaves.

To build an Angular 2 application you define a set of components, for every UI element, screen, and route. An application will always have a root component that contains all other components. In other words, every Angular 2 application will have a component tree.

Leave a comment

Your email address will not be published. Required fields are marked *