Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 749 Bytes

using_other_components.md

File metadata and controls

21 lines (16 loc) · 749 Bytes

Using Other Components

Components depend on other components, directives and pipes. For example, TodoList relies on TodoItem. To let a component know about these dependencies we group them into a module.

import {NgModule} from '@angular/core';
import {TodoInput} from './components/todo-input';
import {TodoItem} from './components/todo-item';
import {TodoList} from './components/todo-list';

@NgModule({
  imports: [ ... ],
  declarations: [ TodoList, TodoItem, TodoInput ],
  bootstrap: [ ... ]
})
export class ToDoAppModule { }

The property declarations expects an array of components, directives and pipes that are part of the module.

Please see the Modules section for more info about NgModule.