2016-02-05 23:27:06 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								include ../_util-fns
							 
						 
					
						
							
								
									
										
										
										
											2015-10-09 15:18:47 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-07 21:11:13 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								// #docregion intro
							 
						 
					
						
							
								
									
										
										
										
											2015-11-10 18:31:46 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								:marked
							 
						 
					
						
							
								
									
										
										
										
											2015-10-31 21:13:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  # Tour of Heroes: the vision
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  Our grand plan is to build an app to help a staffing agency manage its stable of heroes.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  Even heroes need to find work.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  Of course we'll only make a little progress in this tutorial. What we do build will
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  have many of the features we expect to find in a full-blown, data-driven application: acquiring and displaying
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  a list of heroes, editing a selected hero's detail, and navigating among different
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  views of heroic data.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  The Tour of Heroes covers the core fundamentals of Angular.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
										 
							
							
								  We’ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
										 
							
							
								  We’ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  We'll use one-way data binding for read-only data. We'll add editable fields to update a model
							 
						 
					
						
							
								
									
										
										
										
											2016-03-07 20:14:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  with two-way data binding. We'll bind component methods to user events like key strokes and clicks.
							 
						 
					
						
							
								
									
										
										
										
											2015-10-31 21:13:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
										 
							
							
								  We’ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  format data with pipes. We'll create a shared service to assemble our heroes. And we'll use routing to navigate among different views and their components.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
										 
							
							
								  We’ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  Angular can do whatever we need it to do.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
										 
							
							
								  We'll be covering a lot of ground at an introductory level but we’ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  to chapters with greater depth.
							 
						 
					
						
							
								
									
										
										
										
											2016-04-07 21:11:13 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								// #enddocregion intro
							 
						 
					
						
							
								
									
										
										
										
											2015-12-16 21:47:02 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-06-07 15:51:25 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								p Run the #[+liveExampleLink2('', 'toh-6')].
							 
						 
					
						
							
								
									
										
										
										
											2015-11-10 18:31:46 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-07 21:11:13 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								// #docregion main
							 
						 
					
						
							
								
									
										
										
										
											2015-10-16 01:06:56 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								.l-main-section
							 
						 
					
						
							
								
									
										
										
										
											2015-11-10 18:31:46 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								:marked
							 
						 
					
						
							
								
									
										
										
										
											2015-10-31 21:13:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  ## The End Game
							 
						 
					
						
							
								
									
										
										
										
											2015-10-12 18:36:33 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-10-31 21:13:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  Here's a visual idea of where we're going in this tour, beginning with the "Dashboard"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  view and our most heroic heroes:
							 
						 
					
						
							
								
									
										
										
										
											2015-10-09 15:18:47 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-10-31 21:13:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								figure.image-display
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  img(src='/resources/images/devguide/toh/heroes-dashboard-1.png' alt="Output of heroes dashboard")
							 
						 
					
						
							
								
									
										
										
										
											2015-10-09 15:18:47 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-11-10 18:31:46 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								:marked
							 
						 
					
						
							
								
									
										
										
										
											2015-10-31 21:13:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  Above the dashboard are two links ("Dashboard" and "Heroes").
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  We could click them to navigate between this Dashboard and a Heroes view.
							 
						 
					
						
							
								
									
										
										
										
											2015-10-12 18:36:33 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-10-31 21:13:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  Instead we click the dashboard hero named "Magneta" and the router takes us to a "Hero Details" view
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  of that hero where we can change the hero's name.
							 
						 
					
						
							
								
									
										
										
										
											2015-11-10 18:31:46 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-10-31 21:13:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								figure.image-display
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  img(src='/resources/images/devguide/toh/hero-details-1.png' alt="Details of hero in app")
							 
						 
					
						
							
								
									
										
										
										
											2015-10-09 15:18:47 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-11-10 18:31:46 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								:marked
							 
						 
					
						
							
								
									
										
										
										
											2016-01-17 22:49:41 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  Clicking the "Back" button would return us to the "Dashboard".
							 
						 
					
						
							
								
									
										
										
										
											2015-10-31 21:13:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  Links at the top can take us to either of the main views.
							 
						 
					
						
							
								
									
										
										
										
											2016-01-17 22:49:41 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  We'll click "Heroes". The app takes to the "Heroes" master list view.
							 
						 
					
						
							
								
									
										
										
										
											2015-10-15 21:51:10 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-10-31 21:13:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								figure.image-display
							 
						 
					
						
							
								
									
										
										
										
											2015-12-19 02:35:50 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  img(src='/resources/images/devguide/toh/heroes-list-2.png' alt="Output of heroes list app")
							 
						 
					
						
							
								
									
										
										
										
											2015-10-15 21:51:10 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-11-10 18:31:46 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								:marked
							 
						 
					
						
							
								
									
										
										
										
											2015-10-31 21:13:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  We click a different hero and the readonly mini-detail beneath the list reflects our new choice.
							 
						 
					
						
							
								
									
										
										
										
											2015-11-10 18:31:46 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-10-31 21:13:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  We click the "View Details" button to drill into the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  editable details of our selected hero.
							 
						 
					
						
							
								
									
										
										
										
											2015-11-10 18:31:46 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-10-31 21:13:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  The following diagram captures all of our navigation options.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								figure.image-display
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  img(src='/resources/images/devguide/toh/nav-diagram.png' alt="View navigations")
							 
						 
					
						
							
								
									
										
										
										
											2015-10-15 21:51:10 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-11-10 18:31:46 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								:marked
							 
						 
					
						
							
								
									
										
										
										
											2015-11-07 12:27:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  Here's our app in action
							 
						 
					
						
							
								
									
										
										
										
											2015-11-10 18:31:46 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-11-07 12:27:13 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								figure.image-display
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								  img(src='/resources/images/devguide/toh/toh-anim.gif' alt="Tour of Heroes in Action")
							 
						 
					
						
							
								
									
										
										
										
											2015-11-10 18:31:46 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-10-16 01:06:56 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								.l-main-section
							 
						 
					
						
							
								
									
										
										
										
											2015-11-10 18:31:46 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								:marked
							 
						 
					
						
							
								
									
										
										
										
											2015-12-14 22:43:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  ## Up Next
							 
						 
					
						
							
								
									
										
										
										
											2015-10-31 21:13:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
								
									
										 
							
							
								  We’ 
							 
						 
					
						
							
								
									
										
											 
										
											
												docs(tutorial): combines all 4 sections + revisions/updates to a.53, hides 3&4
closes #488
ToH History (oldest-to-latest):
----------------------------
created code example/snippets files for use with +makeExample, replace usage of  "pre.prettyprint.lang-bash" with this:  code-example(format="." language="bash").
fixed spelling errors in examples file path used by +makeExample
changed usage of "code-example" to "+makeExample"
adding code example/snippets files used in toh 1
fixed example file paths, replaced "pre.prettyprint.lang-bash" with "code-example. "
(docs) toh-pt3 initial state
created code examples for display in jade, starting conversion of Google doc and trying +makeExample rendering
all text copied from doc to jade, still some styling and formatting to perform
completed conversion and styling, moved toh3 example files to "tutorial" folder under _examples
created specific code example files for chapter toh 3 and re-pathed references in +makeExample
minor edit
docs) toh combined - initial combined commit
updated ToH for a.52
tons of changes, including de-kebab-ing, removed src folder, updated tsconfig too
fixing snippets using incorrect ending input tag
using inline html and css for the app.component.
ToH Part 1 Code: updated the imports, removed obsolete directive delcarations
ToH Code Part 1: updated to use imports, interface. will hit others soon
toh part 1: ngModel fix
toh part1: removed obsolete story that referred to how we used to have to import and declare all directives we used. yay!
ToH Part 1: updated to use `boot.ts` and `app.component.ts`. this affected the partials, snippets, and the story.
toh part 1: using `npm run go`
toh parts 1 -4: modified all places to use `npm run go`
toh part 1: refactor for jade
toh part 1: fixing the code samples
toh part 2: seeping through the story
toh part 2: fixing snippets.
toh part 2: replaced ngClass with class.selected
toh part 2: removed whitespace
toh part 2: added final state to the code
toh: fixing paths
toh part 4: fixing src/app path to app
toh part 3: fixing folder path
toh part 2: fixed typo
toh part 2: typo on ngModel
toh part 2: added ngif
toh part 2: removed old hero property. moved the details lower, where we need it
toh index: updated hero list image to show consistent styling as the other images here
QS spelling error (targes -> targets)
tweeks: space and ngIF
											 
										 
										
											2015-11-15 18:04:43 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  We'll motivate each step with a requirement that we've
							 
						 
					
						
							
								
									
										
										
										
											2015-10-31 21:13:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  met in countless applications. Everything has a reason.
							 
						 
					
						
							
								
									
										
										
										
											2015-10-09 15:18:47 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-10-31 21:13:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
										 
							
							
								  And we’ 
							 
						 
					
						
							
								
									
										
										
										
											2015-10-09 15:18:47 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
								
									
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-10-31 21:13:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								  [Let's get started!](./toh-pt1.html)
							 
						 
					
						
							
								
									
										
										
										
											2016-04-07 21:11:13 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
								
									
								 
							
							
								// #enddocregion main