Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit 8d6acce

Browse files
naomiblackmhevery
authored andcommitted
chore(docs): Basic descriptions for package libraries
Closes #782
1 parent 5a54729 commit 8d6acce

File tree

8 files changed

+108
-42
lines changed

8 files changed

+108
-42
lines changed

lib/angular.dart

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,31 @@
11
/**
2-
* Angular is a framework for building single page web applications.
2+
* Core functionality for angular.dart, a web framework for Dart.
3+
*
4+
*
5+
* You must import the angular library to use it with Dart, like so:
6+
*
7+
* import 'package:angular/angular.dart';
8+
*
9+
* The angular.dart library includes Angular's Directive and Filter classes:
10+
*
11+
* - [angular.directive](#angular/angular-directive) lists all the basic directives
12+
* - [angular.filter] (#angular/angular-filter) lists all the basic filters
13+
*
14+
* You might also want to optionally import the following Angular libraries:
15+
*
16+
* - [angular.animate](#angular/angular-animate) supports CSS animations that modify the
17+
* lifecycle of a DOM
18+
* element
19+
* - [angular.mock](#angular/angular-mock) provides classes and utilities for testing and
20+
* prototyping
21+
* - [angular.perf](#angular/angular-perf) provides classes to help evaluate performance in your
22+
* app
23+
*
324
*
425
* Further reading:
526
*
6-
* - AngularJS [Overview](http://www.angularjs.org)
7-
* - [Tutorial](https://github.com/angular/angular.dart.tutorial/wiki)
27+
* - AngularDart [Overview](http://www.angulardart.org)
28+
* - [Tutorial](https://angulardart.org/tutorial/)
829
* - [Mailing List](http://groups.google.com/d/forum/angular-dart?hl=en)
930
*
1031
*/

lib/animate/module.dart

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
/**
2-
* Css animation and dom lifecycle management for Angular.
2+
* CSS animation and DOM lifecycle management for AngularDart apps.
33
*
4-
* The [animate] library makes it easier to build animations that affect the
5-
* lifecycle of dom elements. A useful example of this is animating the
6-
* removal of an element from the dom. In order to do this ideally the
4+
* The [angular.animate](#angular/angular-animate) library makes it easier to build animations
5+
* that affect the lifecycle of DOM elements. A useful example of this is animating the
6+
* removal of an element from the DOM. In order to do this ideally the
77
* operation should immediatly execute and manipulate the data model,
8-
* and the framework should handle the actual remove of the dom element once
8+
* and the framework should handle the actual remove of the DOM element once
99
* the animation complets. This ensures that the logic and model of the
1010
* application is seperated so that the state of the model can be reasoned
1111
* about without having to wory about future modifications of the model.
1212
* This library uses computed css styles to calculate the total duration
13-
* of an animation and handles the addition, removal, and modification of dom
13+
* of an animation and handles the addition, removal, and modification of DOM
1414
* elements for block level directives such as `ng-if`, `ng-repeat`,
1515
* `ng-hide`, and more.
1616
*
@@ -19,30 +19,30 @@
1919
* var module = new Module()
2020
* ..install(new NgAnimateModule());
2121
*
22-
* Once the module has been installed, all block level dom manipulations will
22+
* Once the module has been installed, all block level DOM manipulations will
2323
* be routed through the [CssAnimate] class instead of the
2424
* default [NgAnimate] implementation. This will, in turn,
2525
* perform the tracking, manipulation, and computation for animations.
2626
*
2727
* As an example of how this works, lets walk through what happens whan an
28-
* element is added to the dom. The [CssAnimate] implementation will add the
29-
* `.ng-enter` class to new dom elements when they are inserted into the dom
28+
* element is added to the DOM. The [CssAnimate] implementation will add the
29+
* `.ng-enter` class to new DOM elements when they are inserted into the DOM
3030
* by a directive and will read the computed style. If there is a
3131
* transition or keyframe animation, that animation duration will be read,
3232
* and the animation will be performed. The `.ng-enter-active` class will be
33-
* added to the dom element to set the target state for transition based
33+
* added to the DOM element to set the target state for transition based
3434
* animations. When the animation is complete (determined by the
3535
* precomputed duration) the `.ng-enter` and `.ng-enter-active` classes
36-
* will be removed from the dom element.
36+
* will be removed from the DOM element.
3737
*
38-
* When removing elements from the dom, a simliar pattern is followed. The
38+
* When removing elements from the DOM, a simliar pattern is followed. The
3939
* `.ng-leave` class will be added to an element, the transition and / or
4040
* keyframe animation duration will be computed, and if it is non-zero the
4141
* animation will be run by adding the `.ng-leave-active` class. When
4242
* the animation completes, the element will be physically removed from the
43-
* dom.
43+
* DOM.
4444
*
45-
* The same set of steps is run for each of the following types of dom
45+
* The same set of steps is run for each of the following types of DOM
4646
* manipulation:
4747
*
4848
* * `.ng-enter`
@@ -75,7 +75,7 @@
7575
* `ctrl.visible` property goes from `true` to `false`.
7676
*
7777
* The [CssAnimate] will also do optimizations on running animations by
78-
* preventing child dom animations with the [AnimationOptimizer]. This
78+
* preventing child DOM animations with the [AnimationOptimizer]. This
7979
* prevents transitions on child elements while the parent is animating,
8080
* but will not stop running transitions once they have started.
8181
*
@@ -88,9 +88,9 @@
8888
* running animation check.
8989
*
9090
* `ng-animate-children` allows animation to be controlled on large chunks of
91-
* dom. It only affects child elements, and allows the `always`, `never`,
91+
* DOM. It only affects child elements, and allows the `always`, `never`,
9292
* and `auto` values to be specified. Always will always attempt animations
93-
* on child dom directives, never will always prevent them (except in the
93+
* on child DOM directives, never will always prevent them (except in the
9494
* case where a given element has `ng-animate="always"` specified),
9595
* and `auto` will defer the decision to the currently running animation
9696
* check.

lib/bootstrap.dart

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,36 +27,38 @@ class AngularModule extends Module {
2727
}
2828

2929
/**
30-
* This method is the main entry point to an angular application.
30+
* Bootstraps AngularDart and defines which application module(s) are available to the app.
3131
*
32-
* # The [ngBootstrap] is responsible for:
32+
* NgApp is how you configure and run an Angular application. NgApp is abstract. There are two
33+
* implementations: one is dynamic, using Mirrors; the other is static, using code generation.
3334
*
34-
* 1. Locating the root element of the application,
35-
* 2. Creating Angular [NgZone]
36-
* 3. Inside the [NgZone] create an injector
37-
* 4. Retrieve the [Compiler] and compile the root eleement
35+
* To create an NgApp, import angular_dynamic.dart and call ngDynamicApp like so:
36+
*
37+
* import 'package:angular/angular.dart';
38+
* import 'package:angular/angular_dynamic.dart';
3839
*
40+
* class HelloWorldController {
41+
* ...
42+
* }
3943
*
40-
* # Parameters:
44+
* main() {
45+
* ngDynamicApp()
46+
* .addModule(new Module()..type(HelloWorldController))
47+
* .run();
48+
* }
4149
*
42-
* - [module] Optional application module to add to the [Injector].
43-
* - [modules] Optional list of [Module]s to add to the [Injector] (when more
44-
* than one is needed).
45-
* - [element] Optional root element of the application. If non specified, the
46-
* the root element is looked up using the [selector]. If the selector can
47-
* not identify a root, the root [HTML] element is used.
48-
* - [selector] Optional CSS selector used to locate the root element for the
49-
* application.
50-
* - [injectorFactory] Optional factory responsible for creating the injector.
50+
* On `pub build`, ngDynamicApp becomes ngStaticApp, as pub generates the getters,
51+
* setters, annotations, and factories for the root Injector that [ngApp] creates. This
5152
*
5253
*
54+
* Here, the ngBootstrap method performs the following actions:
55+
*
56+
* 1. Locating the root element of the application,
57+
* 2. Creating Angular [NgZone]
58+
* 3. Inside the [NgZone] create an injector
59+
* 4. Retrieve the [Compiler] and compile the root element
5360
*
54-
* # A typical way to boostrap an Angular application:
5561
*
56-
* var myAppModule = new Module();
57-
* myAppModule.type(MyType);
58-
* ....
59-
* Injector injector = ngBootstrap(module: myAppModule);
6062
*/
6163

6264
abstract class NgApp {

lib/directive/module.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/**
2+
*
3+
* Directives available in the main [angular.dart](#angular/angular) library.
4+
*
5+
* This package is imported for you as part of [angular.dart](#angular/angular),
6+
* and lists all of the basic directives that are part of Angular.
7+
*
8+
*
9+
*/
110
library angular.directive;
211

312
import 'package:di/di.dart';

lib/filter/module.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/**
2+
*
3+
* Filters available in the main [angular.dart](#angular/angular) library.
4+
*
5+
* This package is imported for you as part of [angular.dart](#angular/angular),
6+
* and lists all of the basic filters that are part of Angular.
7+
*
8+
*
9+
*/
110
library angular.filter;
211

312
import 'dart:convert' show JSON;

lib/mock/module.dart

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
/**
2+
*
3+
* Classes and utilities for testing and prototyping in AngularDart.
4+
*
5+
* This is an optional library. You must import it in addition to the [angular.dart]
6+
* (#angular/angular) library,
7+
* like so:
8+
*
9+
* import 'package:angular/angular.dart';
10+
* import 'package:angular/mock/module.dart';
11+
*
12+
*
13+
*/
114
library angular.mock;
215

316
import 'dart:async' as dart_async;

lib/perf/module.dart

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
/**
2+
*
3+
* Classes and utilities for analyzing performance in AngularDart.
4+
*
5+
* This is an optional library. You must import it in addition to the [angular.dart]
6+
* (#angular/angular) library,
7+
* like so:
8+
*
9+
* import 'package:angular/angular.dart';
10+
* import 'package:angular/perf/module.dart';
11+
*
12+
*
13+
*/
114
library angular.perf;
215

316
import 'dart:html' as dom;

scripts/generate-documentation.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ echo "Generating documentation"
2020
filter/module.dart \
2121
directive/module.dart \
2222
animate/module.dart \
23-
utils.dart \
2423
mock/module.dart \
2524
perf/module.dart \
2625

0 commit comments

Comments
 (0)