Angular 2.0 Components
Angular 2.0 Components
Modules
designed for performed single task.Every angular app has at least one root module and more featured module.angular is a class which is decorated with @NgModule.
NgModule is a decorator function that takes a single metadata object whose properties describe the module.
similar to a controller class with a template so components deal with view of the Application and the logic on the page.- Declarations : Describes the view class for the module.there are three kind of view class available
- Components
- Directives
- Pipes
- Imports- Define the modules that we want to import in our module.
- Providers- creators of services that this module contributes to the global collection of services; they become accessible in all parts of the app.
- Exports- Defines the name for the module, using which we can use this module.
- Bootstrap- It defines the main component to be Bootstrap in main.ts file.
Components
further in other word You define a component's application logic—what it does to support the view—inside a class. The class interacts with the view through an API of properties and methods.
OR
A component consists of
- Class : consists of properties and methods like C and C#.
- Meta data : defines the way to process a class.
- Template : define the HTML view which is displayed in the application.
Comments
Post a Comment