Skip to content

Angular 2 🚧

Fabien GAUTREAULT edited this page Apr 3, 2021 · 5 revisions

<< Back to Home

This version is the first rewrite of the framework, giving it its basics.

The basic building blocks of an Angular application are NgModules, which provide a compilation context for components. NgModules collect related code into functional sets; an Angular app is defined by a set of NgModules. An app always has at least a root module that enables bootstrapping, and typically has many more feature modules.

See project architecture describe in Angular 5 page.

Basics

Angular uses different concepts to ensure the separation of concerns and a easier maintainance and reusability:

  • Template: HTML layout description of the component. CSS Styling can be extracted in a separate file.
  • Component: Typescript description of the view logic.
  • Service: Class providing specific functionality and used by components through Dependency Injection
  • Module: Declares a compilation context for a set of components dedicated to an application domain, a workflow, or a closely related set of capabilities

Both components and services are simply classes, with decorators that mark their type and provide metadata that tells Angular how to use them.

LNO

Clone this wiki locally