Go to file
Ward Bell 695df67929 docs(testing): simplify and accelerate path to Angular component testing (#2879)
Rob Wormald recognized that we had no plunker for a simple component test. Inspired improved learning path for testing including:
* Add plunkers for both inline and external template versions of  the simplest `BannerComponent`
* Added the banner-specs for that purpose and also a quickstart-specs in the setup folder
* Adjusted prose in testing and setup-systemjs-anatomy to call these out
* Moved testing of external template spec earlier in the guide because it is likely to be needed right away.
* Add comments on the optional "testing" folder and corrects var names to match
* Leaves Jasmine Spec Runner output visible when tests finish
2016-12-05 11:46:53 -08:00
public docs(testing): simplify and accelerate path to Angular component testing (#2879) 2016-12-05 11:46:53 -08:00
scripts chore(README): development setup - add deploy-install step (#2915) 2016-11-30 20:43:16 +00:00
tools docs(testing): simplify and accelerate path to Angular component testing (#2879) 2016-12-05 11:46:53 -08:00
.editorconfig chore: remove end_of_line from editorconfig (#2635) 2016-10-19 18:17:06 +01:00
.eslintrc.js chore(eslint): add eslint config file 2016-09-09 14:44:46 -07:00
.firebaserc chore: fix firebase.json; check-deploy to active firebase project 2016-11-04 11:05:51 -07:00
.gitignore docs: quickstart reboot for Dart (#2867) 2016-11-23 17:58:21 +00:00
.nvmrc chore: update to node 6 (#2301) 2016-09-09 22:23:25 -04:00
.travis.yml chore: travis for 2.2.3 (#2870) 2016-11-24 00:38:49 +01:00
LICENSE chore: update license to MIT 2016-01-08 14:10:38 -08:00
README.md chore(README): development setup - add deploy-install step (#2915) 2016-11-30 20:43:16 +00:00
firebase.json chore(dart): redirect to webdev/angular 2016-12-05 09:54:06 -08:00
gulpfile.js docs(testing): simplify and accelerate path to Angular component testing (#2879) 2016-12-05 11:46:53 -08:00
harp.json chore(bio): update my bio (#2861) 2016-11-27 14:14:26 -08:00
package.json chore: use tsconfig lib (#2840) 2016-11-20 17:28:37 -08:00
pubspec.yaml Dart upgrade to 2.2.0 2016-12-01 08:12:43 -08:00
tslint.json chore: update tslint rules 2016-09-14 15:07:57 +02:00

README.md

Angular.io

Build Status

Angular.io is site for Angular documentation .

This site also includes links to other helpful angular resources including Angular 2, Angular 1, Angular Material, and AngularFire.

Issues

Please file Developer Guide, Cookbook, and code sample issues only in this Angular.io github repo.

Angular API issues, cheatsheet corrections, feature requests, defect reports, and technical questions concerning Angular itself belong in the angular source code github repo. We can't handle those topics here and will ask you to re-post them on the angular repo.

How you can help

Filing issues is helpful but pull requests that improve the docs are even better!

Learn how to contribute to Angular.io.

IMPORTANT: Do NOT make changes to cached files under public/docs/ts/_cache. Cached files are updated through a separate workflow.

Development Setup

This site relies heavily on node and npm.

  1. Make sure you are using at least node v.5+ and latest npm; if not install nvm to get node going on your machine.

  2. Install global npm packages by running ./scripts/before-install.sh

  3. Clone

to the same parent directory. The cloned repo directories must be siblings, with the latter two repo directories named angular and angular-dart, respectively.

  1. cd into root directory angular.io/

  2. Install local npm packages by running ./scripts/install.sh

  3. (OPTIONAL) If you intend on doing full site builds then you must have the Angular Dart repo (see the Clone step above), and Dart tooling available. Both can be installed by running ./scripts/deploy-install.sh

  4. See below for code sample development preparation.

Content Development

All documentation content is written in Jade which has its own syntax. Be aware of the strict demands imposed by this significant-whitespace language. We strongly recommend running one of the gulp serve-and-sync commands described below while editing content so you can see the effect of your changes as you type.

The documentation relies on specific styles and mixins. Learn about those in the documentation styleguide.

The jade documentation files are language-specific directories under either public/docs/. For example, all of the TypeScript docs are in public/docs/ts/latest, e.g.

  • public/docs/ts/latest/quickstart.jade
  • public/docs/ts/latest/guide/architecture.jade
  • public/docs/ts/latest/cookbook/component-communication.jade
  • public/docs/ts/latest/tutorial/toh-pt5.jade

Local server with watches and browser reload

  1. cd into root directory angular.io/
  2. run gulp serve-and-sync
  3. browser will launch on localhost:3000 and stay refreshed automatically.

If you are only going to work on a specific part of the docs, such as the dev guide, then you can use one of the more specific gulp tasks to only watch those parts of the file system:

  • gulp serve-and-sync : watch all the local Jade/Sass files, the API source and examples, and the dev guide files
  • gulp serve-and-sync-api : watch only the API source and example files
  • gulp serve-and-sync-devguide : watch only the dev guide files
  • gulp build-and-serve : watch only the local Jade/Sass files

Code Sample Development

All documentation is supported by sample code and plunkers. Such code resides in the public/docs/_examples directory, under page-specific directories, further divided by language track.

For example, the TypeScript QuickStart sample is in public/docs/_examples/quickstart/ts.

All samples are in a consistent directory structure using the same styles and the same npm packages, including the latest release of Angular. This consistency is possible in part thanks to gulp-driven tooling. To run the samples locally and confirm that they work properly, take the following extra steps to prepare the environment:

  1. cd to public/docs/_examples

  2. install the canonical node packages for all samples by running npm install

  3. cd back up to angular.io root: cd ../../..

  4. run gulp add-example-boilerplate (elevate to admin on Windows) to copy canonical files to the sample directories and create symlinks there for node_modules.

Now cd into any particular sample's language directory (e.g., public/docs/_examples/quickstart/ts) and try:

  • npm start to simultaneously compile-with-watch and serve-in-browser-with-watch
  • npm run tsc to compile only
  • npm run lite to serve-and-watch in browser

Look at the scripts in package.json for other options. Also, open any plunkr.no-link.html to see the code execute in plunker (you may have to run gulp build-plunkers first to create/update).

You must check that your example is free of lint errors.

  • gulp lint

Sample end-to-end tests

All samples should be covered to some degree by end-to-end tests:

  • gulp run-e2e-tests to run all TypeScript and JavaScript tests
  • gulp run-e2e-tests --lang=dart to run all Dart tests
  • gulp run-e2e-tests --lang=all to run TypeScript, JavaScript, and Dart tests
  • gulp run-e2e-tests --filter=quickstart to filter the examples to run, by name
  • gulp run-e2e-tests --fast to ignore npm install, webdriver update and boilerplate copy

Any combination of options is possible.

Resetting the project

This project generates a lot of untracked files, if you wish to reset it to a mint state, you can run:

  • git clean -xdf

Also, there is a script available for Linux, OSX and Windows Gitbash users that will setup the project using the steps shown in this section:

  • ./scripts/install.sh

Run with current build instead of release packages

Can switch the @angular packages in ~/public/docs/_examples/node_modules to the current build packages with

gulp install-example-angular --build

Restore to RELEASE packages with

gulp install-example-angular

These commands will fail if something is locking any of the packages ... as an IDE often does.

The symptom typically is an error trying to rm -rf node_modules/@angular.

Solution: unlock the hold on the package(s). In VS Code, re-load the window (cmd-P then enter >relow).

Technology Used

  • Angular 1.x: The production ready version of Angular
  • Angular Material: An implementation of Material Design in Angular.js
  • Gulp: node-based tooling
  • Harp: The static web server with built-in preprocessing.
  • Sass: A professional grade CSS extension language
  • Normalize: A modern, HTML5-ready alternative to CSS resets
  • Grids: A highly customizable CSS Grid Framework built with Sass
  • Prettify: A JS module and CSS for syntax highlighting of source code snippets.
  • Icomoon: Custom built icon fonts

License

Powered by Google ©2010-2016. Code licensed under an MIT-style License. Documentation licensed under CC BY 4.0.