2015-11-13 07:14:12 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								@cheatsheetSection  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Template syntax
							 
						 
					
						
							
								
									
										
										
										
											2016-08-08 17:18:50 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								@cheatsheetIndex  2 
						 
					
						
							
								
									
										
										
										
											2015-11-13 07:14:12 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								@description  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								@cheatsheetItem  
						 
					
						
							
								
									
										
										
										
											2015-12-09 12:33:42 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								syntax:
							 
						 
					
						
							
								
									
										
										
										
											2015-11-13 07:14:12 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								`<input [value]="firstName">` |`[value]`  
						 
					
						
							
								
									
										
										
										
											2015-12-09 12:33:42 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								description:
							 
						 
					
						
							
								
									
										
										
										
											2015-11-13 07:14:12 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								Binds property `value`  to the result of expression `firstName` .
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								@cheatsheetItem  
						 
					
						
							
								
									
										
										
										
											2015-12-09 12:33:42 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								syntax:
							 
						 
					
						
							
								
									
										
										
										
											2015-11-13 07:14:12 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								`<div [attr.role]="myAriaRole">` |`[attr.role]`  
						 
					
						
							
								
									
										
										
										
											2015-12-09 12:33:42 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								description:
							 
						 
					
						
							
								
									
										
										
										
											2015-11-13 07:14:12 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								Binds attribute `role`  to the result of expression `myAriaRole` .
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								@cheatsheetItem  
						 
					
						
							
								
									
										
										
										
											2015-12-09 12:33:42 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								syntax:
							 
						 
					
						
							
								
									
										
										
										
											2015-11-13 07:14:12 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								`<div [class.extra-sparkle]="isDelightful">` |`[class.extra-sparkle]`  
						 
					
						
							
								
									
										
										
										
											2015-12-09 12:33:42 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								description:
							 
						 
					
						
							
								
									
										
										
										
											2015-12-10 09:52:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Binds the presence of the CSS class `extra-sparkle`  on the element to the truthiness of the expression `isDelightful` .
							 
						 
					
						
							
								
									
										
										
										
											2015-11-13 07:14:12 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								@cheatsheetItem  
						 
					
						
							
								
									
										
										
										
											2015-12-09 12:33:42 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								syntax:
							 
						 
					
						
							
								
									
										
										
										
											2015-11-13 07:14:12 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								`<div [style.width.px]="mySize">` |`[style.width.px]`  
						 
					
						
							
								
									
										
										
										
											2015-12-09 12:33:42 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								description:
							 
						 
					
						
							
								
									
										
										
										
											2015-11-13 07:14:12 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								Binds style property `width`  to the result of expression `mySize`  in pixels. Units are optional.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								@cheatsheetItem  
						 
					
						
							
								
									
										
										
										
											2015-12-09 12:33:42 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								syntax:
							 
						 
					
						
							
								
									
										
										
										
											2015-11-13 07:14:12 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								`<button (click)="readRainbow($event)">` |`(click)`  
						 
					
						
							
								
									
										
										
										
											2015-12-09 12:33:42 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								description:
							 
						 
					
						
							
								
									
										
										
										
											2015-11-13 07:14:12 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								Calls method `readRainbow`  when a click event is triggered on this button element (or its children) and passes in the event object.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								@cheatsheetItem  
						 
					
						
							
								
									
										
										
										
											2015-12-09 12:33:42 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								syntax:
							 
						 
					
						
							
								
									
										
										
										
											2015-11-13 07:14:12 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								`<div title="Hello {{ponyName}}">` |`{{ponyName}}`  
						 
					
						
							
								
									
										
										
										
											2015-12-09 12:33:42 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								description:
							 
						 
					
						
							
								
									
										
										
										
											2015-11-13 07:14:12 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								Binds a property to an interpolated string, e.g. "Hello Seabiscuit". Equivalent to:
							 
						 
					
						
							
								
									
										
										
										
											2016-03-24 14:14:41 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								`<div [title]="'Hello ' + ponyName">`  
						 
					
						
							
								
									
										
										
										
											2015-11-13 07:14:12 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								@cheatsheetItem  
						 
					
						
							
								
									
										
										
										
											2015-12-09 12:33:42 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								syntax:
							 
						 
					
						
							
								
									
										
										
										
											2015-11-13 07:14:12 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								`<p>Hello {{ponyName}}</p>` |`{{ponyName}}`  
						 
					
						
							
								
									
										
										
										
											2015-12-09 12:33:42 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								description:
							 
						 
					
						
							
								
									
										
										
										
											2015-11-13 07:14:12 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								Binds text content to an interpolated string, e.g. "Hello Seabiscuit".
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								@cheatsheetItem  
						 
					
						
							
								
									
										
										
										
											2015-12-09 12:33:42 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								syntax:
							 
						 
					
						
							
								
									
										
										
										
											2015-11-13 07:14:12 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								`<my-cmp [(title)]="name">` |`[(title)]`  
						 
					
						
							
								
									
										
										
										
											2015-12-09 12:33:42 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								description:
							 
						 
					
						
							
								
									
										
										
										
											2015-11-23 16:02:19 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Sets up two-way data binding. Equivalent to: `<my-cmp [title]="name" (titleChange)="name=$event">` 
							 
						 
					
						
							
								
									
										
										
										
											2015-11-13 07:14:12 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								@cheatsheetItem  
						 
					
						
							
								
									
										
										
										
											2015-12-09 12:33:42 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								syntax:
							 
						 
					
						
							
								
									
										
										
										
											2015-11-13 07:14:12 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								`< video  #movieplayer  ... > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  < button  ( click ) = " movieplayer . play ( ) " > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								</ video > `|` #movieplayer `|` (click)` 
						 
					
						
							
								
									
										
										
										
											2015-12-09 12:33:42 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								description:
							 
						 
					
						
							
								
									
										
										
										
											2015-11-13 07:14:12 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								Creates a local variable `movieplayer`  that provides access to the `video`  element instance in data-binding and event-binding expressions in the current template.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								@cheatsheetItem  
						 
					
						
							
								
									
										
										
										
											2015-12-09 12:33:42 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								syntax:
							 
						 
					
						
							
								
									
										
										
										
											2015-12-21 14:40:35 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								`<p *myUnless="myExpression">...</p>` |`*myUnless`  
						 
					
						
							
								
									
										
										
										
											2015-12-09 12:33:42 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								description:
							 
						 
					
						
							
								
									
										
										
										
											2015-11-13 07:14:12 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								The `*`  symbol means that the current element will be turned into an embedded template. Equivalent to:
							 
						 
					
						
							
								
									
										
										
										
											2015-12-21 14:40:35 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								`<template [myUnless]="myExpression"><p>...</p></template>`  
						 
					
						
							
								
									
										
										
										
											2015-11-13 07:14:12 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								@cheatsheetItem  
						 
					
						
							
								
									
										
										
										
											2015-12-09 12:33:42 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								syntax:
							 
						 
					
						
							
								
									
										
										
										
											2015-11-13 07:14:12 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								`<p>Card No.: {{cardNumber | myCreditCardNumberFormatter}}</p>` |`{{cardNumber | myCreditCardNumberFormatter}}`  
						 
					
						
							
								
									
										
										
										
											2015-12-09 12:33:42 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								description:
							 
						 
					
						
							
								
									
										
										
										
											2016-01-11 12:14:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Transforms the current value of expression `cardNumber`  via the pipe called `myCreditCardNumberFormatter` .
							 
						 
					
						
							
								
									
										
										
										
											2015-11-13 07:14:12 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								@cheatsheetItem  
						 
					
						
							
								
									
										
										
										
											2015-12-09 12:33:42 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								syntax:
							 
						 
					
						
							
								
									
										
										
										
											2015-11-13 07:14:12 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								`<p>Employer: {{employer?.companyName}}</p>` |`{{employer?.companyName}}`  
						 
					
						
							
								
									
										
										
										
											2015-12-09 12:33:42 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								description:
							 
						 
					
						
							
								
									
										
										
										
											2016-04-22 23:01:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								The safe navigation operator (`?` ) means that the `employer`  field is optional and if `undefined` , the rest of the expression should be ignored.
							 
						 
					
						
							
								
									
										
										
										
											2016-05-19 19:20:08 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								@cheatsheetItem  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								syntax:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								`<svg:rect x="0" y="0" width="100" height="100"/>` |`svg:`  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								description:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								SVG snippet templates need an `svg:`  prefix on their root element to disambiguate the SVG element from an HTML component.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								@cheatsheetItem  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								syntax:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								`< svg > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  < rect  x = "0"  y = "0"  width = "100"  height = "100" / > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								</ svg > `|` svg` 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								description:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								`<svg>`  root elements are detected as SVG element automatically without the prefix