简体   繁体   中英

What are container components in Angular 2

In Angular 2, it says there are two types of components

1) Container Components 2) Presentational Components

I would like to know more about container components.

Presentation Components:

They are just dumb components which don't use application logic and are used only for delegation of work like date picker widget..etc

Container Components: They are actual application logic containing components which passes data to other components and child components, which manipulates data, decides how the application behaves

You can refer to other information here

Container components, or smart components, are usually the pages you route to.

They contain service methods to load and manipulate data and pass content to the presentational, or dumb, components inside them.

Containers: contains stateful, and often routable, components that pass down data and behaviour-encapsulating callbacks to presentational components (and sometimes other containers).

Source: Rangle.io Angular 2 Guidelines

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM