2015-04-19 13:53:18 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-04-22 08:06:51 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								p.location-badge.
							 
						 
					
						
							
								
									
										
										
										
											2015-04-23 08:27:36 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  exported from <a href="/angular2/annotations.html">angular2/annotations</a>
							 
						 
					
						
							
								
									
										
										
										
											2015-04-19 13:53:18 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								  defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/core/annotations/view.js#L34">angular2/src/core/annotations/view.js (line 34)</a>
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								:markdown
							 
						 
					
						
							
								
									
										
										
										
											2015-04-20 13:57:43 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  Declares the available HTML templates for an application.
							 
						 
					
						
							
								
									
										
										
										
											2015-04-19 13:53:18 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  Each angular component requires a single `@Component` and at least one `@View` annotation. The @View
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  annotation specifies the HTML template to use, and lists the directives that are active within the template.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  When a component is instantiated, the template is loaded into the component's shadow root, and the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  expressions and statements in the template are evaluated against the component.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  
							 
						 
					
						
							
								
									
										
										
										
											2015-04-26 08:01:04 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  For details on the `@Component` annotation, see <a href='Component-class.html'><code>Component</code></a>.
							 
						 
					
						
							
								
									
										
										
										
											2015-04-19 13:53:18 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  ## Example
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  ```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  @Component({
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    selector: 'greet'
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  @View({
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    template: 'Hello {{name}}!',
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    directives: [GreetUser, Bold]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  class Greet {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    name: string;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    constructor() {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      this.name = 'World';
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  ```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								.l-main-section
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  h2 Members
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  .l-sub-section
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    h3 constructor
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    pre.prettyprint
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      code.
							 
						 
					
						
							
								
									
										
										
										
											2015-04-20 13:57:43 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        constructor({
							 
						 
					
						
							
								
									
										
										
										
											2015-04-19 13:53:18 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								          templateUrl,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								          template,
							 
						 
					
						
							
								
									
										
										
										
											2015-04-21 23:34:30 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								          directives,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								          renderer
							 
						 
					
						
							
								
									
										
										
										
											2015-04-19 13:53:18 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								        }: {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								          templateUrl: string,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								          template: string,
							 
						 
					
						
							
								
									
										
										
										
											2015-04-21 23:34:30 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								          directives: List<Type>,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								          renderer: string
							 
						 
					
						
							
								
									
										
										
										
											2015-04-19 13:53:18 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								        })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    :markdown
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  .l-sub-section
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    h3 directives
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    :markdown
							 
						 
					
						
							
								
									
										
										
										
											2015-04-20 13:57:43 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								      Specifies a list of directives that can be used within a template.
							 
						 
					
						
							
								
									
										
										
										
											2015-04-19 13:53:18 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								      
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      Directives must be listed explicitly to provide proper component encapsulation.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      ```javascript
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      @Component({
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								          selector: 'my-component'
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      @View({
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        directives: [For]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        template: '
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        <ul>
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								          <li *for="item in items">{{item}}</li>
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        </ul>'
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      })
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      class MyComponent {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      ```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  .l-sub-section
							 
						 
					
						
							
								
									
										
										
										
											2015-04-21 23:34:30 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    h3 renderer
							 
						 
					
						
							
								
									
										
										
										
											2015-04-19 13:53:18 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    
							 
						 
					
						
							
								
									
										
										
										
											2015-04-21 23:34:30 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    :markdown
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      Specify a custom renderer for this View.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      If this is set, neither `template`, `templateURL` nor `directives` are used.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-04-19 13:53:18 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-04-21 23:34:30 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  .l-sub-section
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    h3 template
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    
							 
						 
					
						
							
								
									
										
										
										
											2015-04-19 13:53:18 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    :markdown
							 
						 
					
						
							
								
									
										
										
										
											2015-04-20 13:57:43 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								      Specifies an inline template for an angular component.
							 
						 
					
						
							
								
									
										
										
										
											2015-04-19 13:53:18 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								      
							 
						 
					
						
							
								
									
										
										
										
											2015-04-28 06:22:25 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								      NOTE: either `templateUrl` or `template` should be used, but not both.
							 
						 
					
						
							
								
									
										
										
										
											2015-04-19 13:53:18 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  .l-sub-section
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    h3 templateUrl
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    :markdown
							 
						 
					
						
							
								
									
										
										
										
											2015-04-20 13:57:43 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								      Specifies a template URL for an angular component.
							 
						 
					
						
							
								
									
										
										
										
											2015-04-19 13:53:18 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								      
							 
						 
					
						
							
								
									
										
										
										
											2015-04-28 06:22:25 -07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								      NOTE: either `templateUrl` or `template` should be used, but not both.
							 
						 
					
						
							
								
									
										
										
										
											2015-04-19 13:53:18 -07:00