简体   繁体   English

Angular 2中的容器组件是什么

[英]What are container components in Angular 2

In Angular 2, it says there are two types of components 在Angular 2中,它说有两种类型的组件

1) Container Components 2) Presentational Components 1)容器组件2)演示组件

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 来源:Rangle.io Angular 2指南

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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