diff --git a/modules/angular2/di_annotations.js b/modules/angular2/di_annotations.js index b2213bbcf6..32d7df5c2b 100644 --- a/modules/angular2/di_annotations.js +++ b/modules/angular2/di_annotations.js @@ -2,6 +2,6 @@ * @module * @public * @description - * Annotations which controll how the dependencies are resolved by the [Injector]. + * Annotations which control how the dependencies are resolved by the {@link Injector}. */ diff --git a/modules/angular2/di_errors.js b/modules/angular2/di_errors.js index 8c0375794d..807936b10f 100644 --- a/modules/angular2/di_errors.js +++ b/modules/angular2/di_errors.js @@ -2,6 +2,6 @@ * @module * @public * @description - * Errors thrown by the [Injector]. + * Errors thrown by the {@link Injector}. */ diff --git a/modules/angular2/forms.js b/modules/angular2/forms.js index db48fcc7a6..6e84373929 100644 --- a/modules/angular2/forms.js +++ b/modules/angular2/forms.js @@ -2,9 +2,9 @@ * @module * @public * @description - * This module is used for handling user input, by defining and building a [FormObject] that consists of [Control] - * objects, and mapping them onto the DOM. [Control] objects can then be used to read information from the form DOM - * elements. + * This module is used for handling user input, by defining and building a {@link ControlGroup} that consists of + * {@link Control} objects, and mapping them onto the DOM. {@link Control} objects can then be used to read information + * from the form DOM elements. * * This module is not included in the `angular2` module; you must import the forms module explicitly. * diff --git a/modules/angular2/src/change_detection/change_detection.js b/modules/angular2/src/change_detection/change_detection.js index 02787f7edf..4f76accead 100644 --- a/modules/angular2/src/change_detection/change_detection.js +++ b/modules/angular2/src/change_detection/change_detection.js @@ -32,6 +32,7 @@ export var defaultPipes = { "keyValDiff" : keyValDiff }; + /** * @exportedAs angular2/change_detection */ @@ -66,4 +67,4 @@ export class JitChangeDetection extends ChangeDetection { } } -export var defaultPipeRegistry = new PipeRegistry(defaultPipes); \ No newline at end of file +export var defaultPipeRegistry = new PipeRegistry(defaultPipes); diff --git a/modules/angular2/src/change_detection/change_detector_ref.js b/modules/angular2/src/change_detection/change_detector_ref.js index c7f2acefa7..fdfd4f2ec0 100644 --- a/modules/angular2/src/change_detection/change_detector_ref.js +++ b/modules/angular2/src/change_detection/change_detector_ref.js @@ -4,7 +4,7 @@ import {CHECK_ONCE, DETACHED, CHECK_ALWAYS} from './constants'; /** * Controls change detection. * - * [ChangeDetectorRef] allows requesting checks for detectors that rely on observables. It also allows detaching and + * {@link ChangeDetectorRef} allows requesting checks for detectors that rely on observables. It also allows detaching and * attaching change detector subtrees. * * @exportedAs angular2/change_detection @@ -42,4 +42,4 @@ export class ChangeDetectorRef { this._cd.mode = CHECK_ALWAYS; this.requestCheck(); } -} \ No newline at end of file +} diff --git a/modules/angular2/src/change_detection/interfaces.js b/modules/angular2/src/change_detection/interfaces.js index 0231ca764e..705d3d6e75 100644 --- a/modules/angular2/src/change_detection/interfaces.js +++ b/modules/angular2/src/change_detection/interfaces.js @@ -14,17 +14,17 @@ export class ProtoChangeDetector { * * Angular implements the following change detection strategies by default: * - * - [dynamicChangeDetection]: slower, but does not require `eval()`. - * - [jitChangeDetection]: faster, but requires `eval()`. + * - {@link DynamicChangeDetection}: slower, but does not require `eval()`. + * - {@link JitChangeDetection}: faster, but requires `eval()`. * - * In JavaScript, you should always use `jitChangeDetection`, unless you are in an environment that has + * In JavaScript, you should always use `JitChangeDetection`, unless you are in an environment that has * [CSP](https://developer.mozilla.org/en-US/docs/Web/Security/CSP), such as a Chrome Extension. * - * In Dart, use `dynamicChangeDetection` during development. The Angular transformer generates an analog to the - * `jitChangeDetection` strategy at compile time. + * In Dart, use `DynamicChangeDetection` during development. The Angular transformer generates an analog to the + * `JitChangeDetection` strategy at compile time. * * - * See: [dynamicChangeDetection], [jitChangeDetection] + * See: {@link DynamicChangeDetection}, {@link JitChangeDetection} * * # Example * ```javascript diff --git a/modules/angular2/src/change_detection/pipes/iterable_changes.js b/modules/angular2/src/change_detection/pipes/iterable_changes.js index a3dac9e50d..cfc1ad2e56 100644 --- a/modules/angular2/src/change_detection/pipes/iterable_changes.js +++ b/modules/angular2/src/change_detection/pipes/iterable_changes.js @@ -210,10 +210,10 @@ export class IterableChanges extends Pipe { /** * This is the core function which handles differences between collections. * - * - [record] is the record which we saw at this position last time. If null then it is a new + * - `record` is the record which we saw at this position last time. If null then it is a new * item. - * - [item] is the current item in the collection - * - [index] is the position of the item in the collection + * - `item` is the current item in the collection + * - `index` is the position of the item in the collection */ _mismatch(record:CollectionChangeRecord, item, index:int):CollectionChangeRecord { // The previous record after which we will append the current one. @@ -284,9 +284,9 @@ export class IterableChanges extends Pipe { } /** - * Get rid of any excess [CollectionChangeRecord]s from the previous collection + * Get rid of any excess {@link CollectionChangeRecord}s from the previous collection * - * - [record] The first excess [CollectionChangeRecord]. + * - `record` The first excess {@link CollectionChangeRecord}. */ _truncate(record:CollectionChangeRecord) { // Anything after that needs to be removed; @@ -588,7 +588,7 @@ class _DuplicateItemRecordList { } /** - * Remove one [CollectionChangeRecord] from the list of duplicates. + * Remove one {@link CollectionChangeRecord} from the list of duplicates. * * Returns whether the list of duplicates is empty. */ @@ -651,7 +651,7 @@ class _DuplicateMap { } /** - * Removes an [CollectionChangeRecord] from the list of duplicates. + * Removes a {@link CollectionChangeRecord} from the list of duplicates. * * The list of duplicates also is removed from the map if it gets empty. */ diff --git a/modules/angular2/src/change_detection/pipes/pipe.js b/modules/angular2/src/change_detection/pipes/pipe.js index 0ff1114648..d39ee32af7 100644 --- a/modules/angular2/src/change_detection/pipes/pipe.js +++ b/modules/angular2/src/change_detection/pipes/pipe.js @@ -1,5 +1,5 @@ /** - * Indicates that the result of a [Pipe] transformation has not changed since the last time the pipe was called. + * Indicates that the result of a {@link Pipe} transformation has not changed since the last time the pipe was called. * * Suppose we have a pipe that computes changes in an array by performing a simple diff operation. If * we call this pipe with the same array twice, it will return `NO_CHANGE` the second time. @@ -12,7 +12,7 @@ export var NO_CHANGE = new Object(); /** * An interface for extending the list of pipes known to Angular. * - * If you are writing a custom [Pipe], you must extend this interface. + * If you are writing a custom {@link Pipe}, you must extend this interface. * * #Example * diff --git a/modules/angular2/src/core/annotations/annotations.js b/modules/angular2/src/core/annotations/annotations.js index 692404863b..1510f8b159 100644 --- a/modules/angular2/src/core/annotations/annotations.js +++ b/modules/angular2/src/core/annotations/annotations.js @@ -8,32 +8,32 @@ import {DEFAULT} from 'angular2/change_detection'; /** * Directives allow you to attach behavior to elements in the DOM. * - * Directive is an abstract concept, instead use concrete directives: [Component], [DynamicComponent], [Decorator] - * or [Viewport]. + * Directive is an abstract concept, instead use concrete directives: {@link Component}, {@link DynamicComponent}, {@link Decorator} + * or {@link Viewport}. * - * A directive consists of a single directive annotation and a controller class. When the directive's [selector] matches + * A directive consists of a single directive annotation and a controller class. When the directive's `selector` matches * elements in the DOM, the following steps occur: * - * 1. For each directive, the [ElementInjector] attempts to resolve the directive's constructor arguments. - * 2. Angular instantiates directives for each matched element using [ElementInjector] in a depth-first order, + * 1. For each directive, the `ElementInjector` attempts to resolve the directive's constructor arguments. + * 2. Angular instantiates directives for each matched element using `ElementInjector` in a depth-first order, * as declared in the HTML. * * ## Understanding How Injection Works * * There are three stages of injection resolution. * - *Pre-existing Injectors*: - * - The terminal [Injector] cannot resolve dependencies. It either throws an error or, if the dependency was + * - The terminal {@link Injector} cannot resolve dependencies. It either throws an error or, if the dependency was * specified as `@Optional`, returns `null`. * - The platform injector resolves browser singleton resources, such as: cookies, title, location, and others. - * - *Component Injectors*: Each `@Component` has its own [Injector], and they follow the same parent-child hierarchy + * - *Component Injectors*: Each `@Component` has its own {@link Injector}, and they follow the same parent-child hierarchy * as the components in the DOM. - * - *Element Injectors*: Each component has a Shadow DOM. Within the Shadow DOM each element has an [ElementInjector] + * - *Element Injectors*: Each component has a Shadow DOM. Within the Shadow DOM each element has an `ElementInjector` * which follow the same parent-child hierarchy as the DOM elements themselves. * * When a template is instantiated, it also must instantiate the corresponding directives in a depth-first order. The - * current [ElementInjector] resolves the constructor dependencies for each directive. + * current `ElementInjector` resolves the constructor dependencies for each directive. * - * Angular then resolves dependencies as follows, according to the order in which they appear in the [View]: + * Angular then resolves dependencies as follows, according to the order in which they appear in the {@link View}: * * 1. Dependencies on the current element * 2. Dependencies on element injectors and their parents until it encounters a Shadow DOM boundary @@ -41,21 +41,21 @@ import {DEFAULT} from 'angular2/change_detection'; * 4. Dependencies on pre-existing injectors * * - * The [ElementInjector] can inject other directives, element-specific special objects, or it can delegate to the parent + * The `ElementInjector` can inject other directives, element-specific special objects, or it can delegate to the parent * injector. * * To inject other directives, declare the constructor parameter as: * - `directive:DirectiveType`: a directive on the current element only * - `@Ancestor() directive:DirectiveType`: any directive that matches the type between the current element and the - * Shadow DOM root. Current element is not included in the resolution, therefor even if it could resolve it, it will + * Shadow DOM root. Current element is not included in the resolution, therefore even if it could resolve it, it will * be ignored. * - `@Parent() directive:DirectiveType`: any directive that matches the type on a direct parent element only. - * - `@Children query:Query`: A live collection of direct child directives [TO BE IMPLEMENTED]. - * - `@Descendants query:Query`: A live collection of any child directives [TO BE IMPLEMENTED]. + * - `@Children query:Query`: A live collection of direct child directives (will be implemented in later release). + * - `@Descendants query:Query`: A live collection of any child directives (will be implemented in later relaese). * * To inject element-specific special objects, declare the constructor parameter as: * - `element: NgElement` to obtain a DOM element (DEPRECATED: replacement coming) - * - `viewContainer: ViewContainer` to control child template instantiation, for [Viewport] directives only + * - `viewContainer: ViewContainer` to control child template instantiation, for {@link Viewport} directives only * - `bindingPropagation: BindingPropagation` to control change detection in a more granular way. * * ## Example @@ -184,32 +184,35 @@ import {DEFAULT} from 'angular2/change_detection'; * `dependency="1"`. * * - * ### Injecting a live collection of direct child directives [PENDING IMPLEMENTATION] + * ### Injecting a live collection of direct child directives + * * * A directive can also query for other child directives. Since parent directives are instantiated before child - * directives, a directive can't simply inject the list of child directives. Instead, the directive asynchronously - * injects a [Query], which updates as children are added, removed, or moved by any [ViewPort] directive such as a - * `for`, an `if`, or a `switch`. + * directives, a directive can't simply inject the list of child directives. Instead, the directive + * injects a {@link QueryList}, which updates its contents as children are added, removed, or moved by any + * {@link Viewport} directive such as a `for`, an `if`, or a `switch`. * * ``` * @Decorator({ selector: '[my-directive]' }) * class MyDirective { - * constructor(@Children() dependencies:Query) { + * constructor(@Query(Marker) dependencies:QueryList) { * } * } * ``` * - * This directive would be instantiated with a [Query] which contains `Dependency` 4 and 6. Here, `Dependency` 5 would - * not be included, because it is not a direct child. + * This directive would be instantiated with a {@link QueryList} which contains `Dependency` 4 and 6. Here, `Dependency` + * 5 would not be included, because it is not a direct child. * - * ### Injecting a live collection of direct descendant directives [PENDING IMPLEMENTATION] + * ### Injecting a live collection of descendant directives + * + * Note: This is will be implemented in later release. () * * Similar to `@Children` above, but also includes the children of the child elements. * * ``` * @Decorator({ selector: '[my-directive]' }) * class MyDirective { - * constructor(@Children() dependencies:Query) { + * constructor(@QueryDescendents(Marker) dependencies:QueryList) { * } * } * ``` @@ -279,7 +282,7 @@ export class Directive extends Injectable { * - `directiveProperty` specifies the component property where the value is written. * - `bindingProperty` specifies the DOM property where the value is read from. * - * You can include [Pipes] when specifying a `bindingProperty` to allow for data transformation and structural + * You can include a {@link Pipe} when specifying a `bindingProperty` to allow for data transformation and structural * change detection of the value. These pipes will be evaluated in the context of this component. * * @@ -333,7 +336,9 @@ export class Directive extends Injectable { * You can also use pipes when writing binding definitions for a directive. * * For example, we could write a binding that updates the directive on structural changes, rather than on reference - * changes, as normally occurs in change detection. (See: [Pipe] and [keyValueDiff] documentation for more details.) + * changes, as normally occurs in change detection. + * + * See {@link Pipe} and {@link keyValDiff} documentation for more details. * * ``` * @Decorator({ @@ -399,7 +404,7 @@ export class Directive extends Injectable { * When writing a directive event binding, you can also refer to the following local variables: * - `$event`: Current event object which triggered the event. * - `$target`: The source of the event. This will be either a DOM element or an Angular directive. - * [TO BE IMPLEMENTED] + * (will be implemented in later release) * * * ## Syntax @@ -443,7 +448,7 @@ export class Directive extends Injectable { /** * Specifies a set of lifecycle hostListeners in which the directive participates. * - * See: [onChange], [onDestroy], [onAllChangesDone] for details. + * See {@link onChange}, {@link onDestroy}, {@link onAllChangesDone} for details. */ lifecycle:List; //List @@ -471,9 +476,9 @@ export class Directive extends Injectable { } /** - * Returns true if a directive participates in a given [LifecycleEvent]. + * Returns true if a directive participates in a given `LifecycleEvent`. * - * See: [onChange], [onDestroy], [onAllChangesDone] for details. + * See {@link onChange}, {@link onDestroy}, {@link onAllChangesDone} for details. */ hasLifecycleHook(hook:string):boolean { return isPresent(this.lifecycle) ? ListWrapper.contains(this.lifecycle, hook) : false; @@ -489,11 +494,11 @@ export class Directive extends Injectable { * When a component is instantiated, Angular * - creates a shadow DOM for the component. * - loads the selected template into the shadow DOM. - * - creates a child [Injector] which is configured with the [Component.injectables]. + * - creates a child {@link Injector} which is configured with the `injectables` for the {@link Component}. * * All template expressions and statements are then evaluated against the component instance. * - * For details on the `@View` annotation, see [View]. + * For details on the `@View` annotation, see {@link View}. * * ## Example * @@ -530,17 +535,17 @@ export class Component extends Directive { /** * Defines the set of injectable objects that are visible to a Component and its children. * - * The [injectables] defined in the Component annotation allow you to configure a set of bindings for the component's + * The `injectables` defined in the Component annotation allow you to configure a set of bindings for the component's * injector. * * When a component is instantiated, Angular creates a new child Injector, which is configured with the bindings in - * the Component [injectables] annotation. The injectable objects then become available for injection to the component + * the Component `injectables` annotation. The injectable objects then become available for injection to the component * itself and any of the directives in the component's template, i.e. they are not available to the directives which * are children in the component's light DOM. * * - * The syntax for configuring the [injectables] injectable is identical to [Injector] injectable configuration. See - * [Injector] for additional detail. + * The syntax for configuring the `injectables` injectable is identical to {@link Injector} injectable configuration. + * See {@link Injector} for additional detail. * * * ## Simple Example @@ -656,7 +661,7 @@ export class Component extends Directive { */ export class DynamicComponent extends Directive { /** - * Same as [Component.injectables]. + * Same as `injectables` in the {@link Component}. */ // TODO(vsankin): Please extract into AbstractComponent injectables:any; //List; @@ -696,10 +701,10 @@ export class DynamicComponent extends Directive { * (see: http://en.wikipedia.org/wiki/Composition_over_inheritance) * * Decorators: - * - are simplest form of [Directive]s. + * - are simplest form of {@link Directive}s. * - are best used as a composition pattern () * - * Decorators differ from [Component]s in that they: + * Decorators differ from {@link Component}s in that they: * - can have multiple decorators per element * - do not create their own evaluation context * - do not have a template (and therefor do not create Shadow DOM) @@ -788,11 +793,11 @@ export class Decorator extends Directive { /** * Directive that controls the instantiation, destruction, and positioning of inline template elements. * - * A viewport directive uses a [ViewContainer] to instantiate, insert, move, and destroy views at runtime. - * The [ViewContainer] is created as a result of `