Setup for local development

Setup a local development environment

Setting up a new project on your machine is quick and easy with the QuickStart seed, maintained on github.

Make sure you have the Dart SDK installed. Then ...

  1. Create a project folder (you can call it quickstart and rename it later).
  2. Clone or download the QuickStart seed into your project folder.
  3. Get pub packages.
  4. Run pub serve to launch the sample application.

Clone

Perform the clone-to-launch steps with these terminal commands.

git clone https://github.com/angular-examples/quickstart.git quickstart
cd quickstart
pub get
pub serve

Download

Download the QuickStart seed and unzip it into your project folder. Then perform the remaining steps with these terminal commands.

cd quickstart
pub get
pub serve

What's in the QuickStart seed?

The QuickStart project / downloadable example (view source) can conveniently be used to seed new projects. It contains the following core files:

  1. import 'package:angular2/core.dart';
  2. @Component(
  3. selector: 'my-app',
  4. template: '<h1>Hello {{name}}</h1>')
  5. class AppComponent {
  6. var name = 'Angular';
  7. }

These files are organized as follows:

angular_quickstart
lib
app_component.dart
pubspec.yaml
web
index.html
main.dart
styles.css

All guides and cookbooks have at least these core files. Each file has a distinct purpose and evolves independently as the application grows.

FilePurpose
app_component.dart

Defines the same AppComponent as the one in the QuickStart repository. It is the root component of what will become a tree of nested components as the application evolves.

main.dart

Compiles the application with the JiT compiler and bootstraps the application to run in the browser. That's a reasonable choice for the development of most projects and it's the only viable choice for a sample running in a live-coding environment like Plunker. You'll learn about alternative compiling and deployment options later in the documentation.

Next Step

If you're new to Angular, we recommend staying on the learning path.



Appendix: the Dart SDK

Install the Dart SDK, if not already on your machine, and any tools you like to use with Dart. The Dart SDK includes tools such as pub, the Dart package manager. If you don't have a favorite Dart editor already, try WebStorm, which comes with a Dart plugin. You can also download Dart plugins for other IDEs and editors.