| 
									
										
										
										
											2016-02-02 14:39:34 +01:00
										 |  |  | // #docregion
 | 
					
						
							| 
									
										
										
										
											2016-05-03 14:06:32 +02:00
										 |  |  | import { Component } from '@angular/core'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import { NameChildComponent } from './name-child.component'; | 
					
						
							| 
									
										
										
										
											2016-02-02 14:39:34 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | @Component({ | 
					
						
							|  |  |  |   selector: 'name-parent', | 
					
						
							|  |  |  |   template: `
 | 
					
						
							|  |  |  |     <h2>Master controls {{names.length}} names</h2> | 
					
						
							| 
									
										
										
										
											2016-04-29 01:36:35 +01:00
										 |  |  |     <name-child *ngFor="let name of names" | 
					
						
							| 
									
										
										
										
											2016-02-02 14:39:34 +01:00
										 |  |  |       [name]="name"> | 
					
						
							|  |  |  |     </name-child> | 
					
						
							|  |  |  |   `,
 | 
					
						
							|  |  |  |   directives: [NameChildComponent] | 
					
						
							|  |  |  | }) | 
					
						
							|  |  |  | export class NameParentComponent { | 
					
						
							|  |  |  |   // Displays 'Mr. IQ', '<no name set>', 'Bombasto'
 | 
					
						
							|  |  |  |   names = ['Mr. IQ', '   ', '  Bombasto  ']; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | // #enddocregion
 |