Application Structure with Components

A useful way of conceptualizing Angular application design is to look at it as a tree of nested components, each having an isolated scope.

For example consider the following:

  1. <rio-todo-app>
  2. <rio-todo-list>
  3. <rio-todo-item></rio-todo-item>
  4. <rio-todo-item></rio-todo-item>
  5. <rio-todo-item></rio-todo-item>
  6. </rio-todo-list>
  7. <rio-todo-form></rio-todo-form>
  8. </rio-todo-app>

At the root we have rio-todo-app which consists of a rio-todo-list and a rio-todo-form. Within the list we have several rio-todo-items. Each of these components is visible to the user, who can interact with these components and perform actions.

原文: https://angular-2-training-book.rangle.io/handout/components/app_structure_with_components.html