-
Book Overview & Buying
-
Table Of Contents
Beginning Server-Side Application Development with Angular
By :
In this section, we will take a look at how we can differentiate our components by making a distinction between container and presentational components. Sometimes, they are also called smart and dumb components, referring to how much knowledge of the world outside of the components each of them has.
The main difference we can make is the following:
A presentational component is responsible for how things look
A container component is responsible for how things work
We will dive into more details of why this distinction is important when we create them, but we can give away a few things already.
We can say the following about presentational components:
They get their data passed in using the @Input() decorator
Any operations are passed up using the @Output() decorator
They handle the markup and the styling of the application
They mostly just contain other presentational components
They have no knowledge (or dependencies) on any routes or services from...
Change the font size
Change margin width
Change background colour