2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								block includes
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  include _util-fns
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  - var _Install = 'Install'
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  - var _prereq = 'Node.js and npm'
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								  - var _angular_browser_uri = '@angular/platform-browser-dynamic'
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  - var _angular_core_uri = '@angular/core'
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  - var _stepInit = 4 // Step # after NgModule step
							 
						 
					
						
							
								
									
										
										
										
											2016-11-21 09:14:03 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  - var _quickstartSrcURL='https://github.com/angular/quickstart/blob/master/README.md'
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								//- TS/Dart shared step counter
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								- var step = _stepInit
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								+ifDocsFor('ts')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  aside.is-right
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    :marked
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      The live example link opens the finished application in
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      <a href="http://plnkr.co/" title="Plunker" target="_blank">Plunker</a> so that you can interact
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      with the code. You'll find live examples at the start of most sections.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								:marked
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  The QuickStart application has the structure of a real-world Angular application and
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  displays the simple message:
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								figure.image-display
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  img(src='/resources/images/devguide/quickstart/hello-angular.png' alt="Output of QuickStart app")
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								:marked
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  **Try it out**. Here's a link to a <live-example></live-example>.
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								+ifDocsFor('ts')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  :marked
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    You can also <a href="!{_quickstartSrcURL}" target="_blank">
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    clone the entire QuickStart application</a> from GitHub.
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								h1 Build this application!
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								:marked
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  - [Prerequisite](#prereq): Install #{_prereq}.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  - [Step 1](#create-and-configure): Create and configure the project.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  - [Step 2](#ngmodule): Create your application.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  <li if-docs="ts">[Step 3](#root-component): Create a component and add it to your application.</li>
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  - [Step !{step++}](#main): Start up your application.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  - [Step !{step++}](#index): Define the web page that hosts the application.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  - [Step !{step++}](#build-and-run): Build and run the application.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  - [Step !{step++}](#make-changes): Make some live changes.
							 
						 
					
						
							
								
									
										
										
										
											2016-11-20 15:33:08 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  - [Wrap up and next steps](#wrap-up)
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								- var step = _stepInit // reinitialize step counter for headers to come
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								.l-main-section#prereq
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								h2 Prerequisite: Install #{_prereq}
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								block setup-tooling
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  :marked
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    If Node.js and npm aren't already on your machine, <a href="http://blog.npmjs.org/post/85484771375/how-to-install-npm"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    target="_blank">install them</a>. Our examples require node **v4.x.x** or higher and
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    npm **3.x.x** or higher. To check which version you are using, run `node -v` and `npm -v`
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    in a terminal window.
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								.l-main-section
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								h2#create-and-configure Step 1: Create and configure the project
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								- var _package_and_config_files = _docsFor == 'dart' ? 'pubspec.yaml' : 'configuration files'
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								:marked
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  In this step you will:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  * [Create the project folder](#create-the-project-folder)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  * [Create #{_package_and_config_files}](#add-config-files)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  * [#{_Install} packages](#install-packages)
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								h3 Create the project folder
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								:marked
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  Using a terminal window, create a directory for the project, and change into this
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  directory.
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								- var _ = _docsFor == 'dart' ? '_' : '-';
							 
						 
					
						
							
								
									
										
										
										
											2016-09-12 08:34:29 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								code-example(language="sh" class="code-shell").
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  mkdir angular!{_}quickstart
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  cd    angular!{_}quickstart
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								h3#add-config-files Create #{_package_and_config_files}
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								block package-and-config-files
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  - var _tsconfigUri = 'guide/typescript-configuration.html#tsconfig'
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  p Our typical Angular project needs several configuration files:
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								  ul
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    li.
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      #[b package.json] identifies npm package dependencies for the project.
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    li.
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      #[b tsconfig.json] defines how the TypeScript compiler generates JavaScript from the project's
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      files.
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    li.
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								      #[b systemjs.config.js] provides information to a module loader about where to find
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      application modules, and registers all the necessary packages. It also
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      contains other packages that will be needed by later documentation examples.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  p.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    Create each of these files in your project directory. Populate them by pasting in text from
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    the tabs in the example box below.
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  a#config-files
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  +makeTabs(`
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      quickstart/ts/package.1.json,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      quickstart/ts/tsconfig.1.json,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      quickstart/ts/systemjs.config.1.js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    `, '', `
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      package.json,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      tsconfig.json,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      systemjs.config.js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    `)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  p.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    Learn more about these configuration files in the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    #[a(href="guide/npm-packages.html") Npm Package Configuration] guide and the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    #[a(href="#{_tsconfigUri}") TypeScript Configuration] guide.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    A detailed discussion of module loading is beyond the scope of this guide.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  .callout.is-helpful
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    header SystemJS or Webpack?
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    p.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      Although we use SystemJS for illustrative purposes here, it's only one option for loading
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      modules. Use the module loader that you prefer. For Webpack and Angular, see <a
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      href="guide/webpack.html" >
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      Webpack: an Introduction</a>. Or, learn more about SystemJS configuration in general <a href="https://github.com/systemjs/systemjs/blob/master/docs/config-api.md" target="_blank">here</a>.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  h3#install-packages #{_Install} packages
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								block install-packages
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  :marked
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    Using npm from the command line, install the packages listed in `package.json` with the command:
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-09-12 08:34:29 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  code-example(language="sh" class="code-shell").
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    npm install
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  :marked
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    Error messages—in red—might appear during the install, and you might see `npm WARN` messages. As long as there are no `npm ERR!` messages at the end, you can assume success.
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  :marked
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    You should now have the following structure:
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  .filetree
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    .file angular-quickstart
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    .children
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      .file node_modules ...
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      .file package.json
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      .file systemjs.config.js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      .file tsconfig.json
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								:marked
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  You're now ready to write some code!
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								.l-main-section
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								h2#ngmodule Step 2: Create your application
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								block create-your-app
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  :marked
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    You compose Angular applications into closely related blocks of functionality with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    [NgModules](guide/ngmodule.html). Angular itself is split into separate Angular Modules. This
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    makes it possible for you to keep payload size small by only importing the parts of Angular
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    that your application needs.
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    Every Angular application has at least one module: the _root module_, named `AppModule` here.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								:marked
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								  **Create #{_an} #{_appDir} subfolder** off the project root directory:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								code-example.code-shell.
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								  mkdir #{_appDir}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								+ifDocsFor('ts')
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								  :marked
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    Create the file `app/app.module.ts` with the following content:
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  +makeExample('app/app.module.1.ts')(format='.')
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  :marked
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    This is the entry point to your application.
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    Since the QuickStart application is a web application that runs in a browser, your root module
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    needs to import the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    [`BrowserModule`](../latest/api/platform-browser/index/BrowserModule-class.html)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    from `@angular/platform-browser` to the `imports` array.
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    This is the smallest amount of Angular that is needed for a minimal application to run in the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    browser.
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    The QuickStart application doesn't do anything else, so you don't need any other modules. In a real
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    application, you'd likely import [`FormsModule`](../latest/api/forms/index/FormsModule-class.html) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    as well as [`RouterModule`](../latest/api/router/index/RouterModule-class.html) and
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    [`HttpModule`](../latest/api/http/index/HttpModule-class.html). These are introduced in the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    [Tour of Heroes Tutorial](./tutorial/).
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  .l-main-section
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  h2#root-component Step 3: Create a component and add it to your application
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								:marked
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  Every Angular application has at least one component: the _root component_, named `AppComponent`
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  here.
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  Components are the basic building blocks of Angular applications. A component controls a portion
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  of the screen—a *view*—through its associated template.
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								#app-component
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								:marked
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  **Create the component file** <span ngio-ex>app/app.component.ts</span> with the following content:
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								+makeExample('app/app.component.ts')
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								- var _decorator_function = _docsFor == 'dart' ? 'annotation' : 'decorator function';
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								:marked
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  The QuickStart application has the same essential structure as any other Angular component:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    * **An import statement**. Importing gives your component access to
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    Angular's core [`@Component` !{_decorator_function}](./api/core/index/Component-decorator.html).
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    * **A @Component #{_decorator}** that associates *metadata* with the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        `AppComponent` component class:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      - a *selector* that specifies a simple CSS selector for an HTML element that represents
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        the component.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      - a *template* that tells Angular how to render the component's view.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    * **A component class** that controls the appearance and behavior of a view
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    through its template. Here, you only have the root component, `AppComponent`. Since you don't
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    need any application logic in the simple QuickStart example, it's empty.
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								+ifDocsFor('ts')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  :marked
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    You *export* the `AppComponent` class so that you can *import* it into the application that you
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    just created.
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    Edit the file `app/app.module.ts` to import your new `AppComponent` and add it in the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    declarations and bootstrap fields in the `NgModule` decorator:
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  +makeExample('app/app.module.ts')
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								.l-main-section
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								h2#main Step !{step++}: Start up your application
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								block create-main
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  :marked
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    Now you need to tell Angular to start up your application.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    Create the file `app/main.ts` with the following content:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+makeExample('app/main.ts')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								- var _pBD_bootstrapModule = _docsFor == 'dart' ? _bootstrapModule : 'platformBrowserDynamic().bootstrapModule'
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								:marked
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  This code initializes the platform that your application runs in, then uses the platform to
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  bootstrap your `!{_AppModuleVsAppComp}`.
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  ### Why create separate *<span ngio-ex>main.ts</span>*<span if-docs="ts">, app module</span> and app component files?
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  App bootstrapping is a separate concern from<span if-docs="ts"> creating a module or</span>
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  presenting a view. Testing the component is much easier if it doesn't also try to run the entire application.
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								.callout.is-helpful
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  header Bootstrapping is platform-specific
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  :marked
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    Because the QuickStart application runs directly in the browser, `main.ts` imports the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    `!{_platformBrowserDynamicVsBootStrap}` function from `#{_angular_browser_uri}`, not
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    `#{_angular_core_uri}`. On a mobile device, you might load a !{_moduleVsComp} with
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    [Apache Cordova](https://cordova.apache.org/) or
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    [NativeScript](https://www.nativescript.org/), using a bootstrap function that's specific
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    to that platform.
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								.l-main-section
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								h2#index Step !{step++}: Define the web page that hosts the application
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								:marked
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  In the *#{_indexHtmlDir}* folder,
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								  create an `index.html` file and paste the following lines into it:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+makeExample('index.html')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								block commentary-on-index-html
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  :marked
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    The noteworthy sections here are:
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    * JavaScript libraries: `core-js` polyfills for older browsers, the `zone.js` and
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    `reflect-metadata` libraries needed by Angular, and the `SystemJS` library for module loading.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    * Configuration file for `SystemJS`, and a script
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      where you import and run the `app` module which refers to the `main` file that you just
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      wrote.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    * The `<my-app>` tag in the `<body>` which is *where your app lives!*
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								:marked
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  ### Add some style
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  Styles aren't essential, but they're nice, and `index.html` assumes that you have
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								  a stylesheet called `styles.css`.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  Create a `styles.css` file in the *#{_indexHtmlDir}* folder, and start styling,
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								  perhaps with the minimal styles shown below.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+makeExcerpt('styles.css (excerpt)', 'quickstart')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								.callout.is-helpful
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  :marked
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    For the full set of master styles used by the documentation samples,
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    see [styles.css](https://github.com/angular/angular.io/blob/master/public/docs/_examples/_boilerplate/styles.css).
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								.l-main-section#build-and-run
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								h2 Step !{step++}: Build and run the application
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								block run-app
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  :marked
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    Open a terminal window and enter this command:
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  code-example.code-shell.
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    npm start
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  aside.is-right
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    :marked
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      [Read more](https://github.com/angular/quickstart/blob/master/README.md#npm-scripts) about
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      other useful npm scripts included in this example's `package.json`.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								  :marked
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    That command runs the following two parallel node processes:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    * The TypeScript compiler in watch mode.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    * A static file server called _lite-server_ that loads `index.html` in a browser
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    and refreshes the browser when application files change.
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    In a few moments, a browser tab should open and display the following:
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								figure.image-display
							 
						 
					
						
							
								
									
										
										
										
											2016-11-05 13:12:11 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  img(src='/resources/images/devguide/quickstart/hello-angular.png' alt="Output of QuickStart app")
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								block build-app
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  //- Nothing for ts.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								.l-main-section#make-changes
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								h2 Step !{step++}: Make some live changes
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								:marked
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  Try changing the message in <span ngio-ex>app/app.component.ts</span> to "Hello Again Angular!".
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								block server-watching
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  :marked
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    The TypeScript compiler and `lite-server` will detect your change, recompile the TypeScript into JavaScript,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    refresh the browser, and display your revised message.
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    Close the terminal window when you're done to terminate both the compiler and the server.
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								.l-main-section
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								h2#wrap-up Wrap up and next steps
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								:marked
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  The final project folder structure looks like this:
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								block project-file-structure
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  .filetree
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    .file angular-quickstart
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    .children
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      .file app
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      .children
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        .file app.component.ts
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        .file app.module.ts
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        .file main.ts
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      .file node_modules ...
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      .file index.html
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      .file package.json
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      .file styles.css
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      .file systemjs.config.js
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      .file tsconfig.json
							 
						 
					
						
							
								
									
										
										
										
											2016-11-20 15:33:08 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								block project-files
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  :marked
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    To see the file contents, open the <live-example></live-example>.
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								.l-main-section
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								:marked
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  ## What next?
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  This first application doesn't do much. It's basically "Hello, World" for Angular.
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  You wrote a little Angular component, created a simple `index.html`, and launched with a
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  static file server.
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+ifDocsFor('ts')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  :marked
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    You also created the basic application setup that you'll re-use for other
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    sections in this guide. From here, the changes you'll make in the
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    `package.json` or `index.html` files are only minor updates to add libraries or some css
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    stylesheets. You also won't need to revisit module loading again.
							 
						 
					
						
							
								
									
										
										
										
											2016-08-11 11:29:19 -07:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								:marked
							 
						 
					
						
							
								
									
										
										
										
											2016-11-18 13:23:38 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  To take the next step and build a small application that demonstrates real features that you can
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  build with Angular, carry on to the [Tour of Heroes tutorial](./tutorial)!