docs(upgrade): move examples etc into `@usageNotes` (#26039)

PR Close #26039
This commit is contained in:
Pete Bacon Darwin 2018-09-20 14:43:43 +01:00 committed by Kara Erickson
parent c08549ae38
commit fef9cebed0
5 changed files with 27 additions and 18 deletions

View File

@ -29,6 +29,7 @@ interface Thenable<T> {
* This helper function returns a factory function to be used for registering * This helper function returns a factory function to be used for registering
* an AngularJS wrapper directive for "downgrading" an Angular component. * an AngularJS wrapper directive for "downgrading" an Angular component.
* *
* @usageNotes
* ### Examples * ### Examples
* *
* Let's assume that you have an Angular component called `ng2Heroes` that needs * Let's assume that you have an Angular component called `ng2Heroes` that needs

View File

@ -20,6 +20,7 @@ import {INJECTOR_KEY} from './constants';
* This helper function returns a factory function that provides access to the Angular * This helper function returns a factory function that provides access to the Angular
* service identified by the `token` parameter. * service identified by the `token` parameter.
* *
* @usageNotes
* ### Examples * ### Examples
* *
* First ensure that the service to be downgraded is provided in an `NgModule` * First ensure that the service to be downgraded is provided in an `NgModule`

View File

@ -30,7 +30,8 @@ let upgradeCount: number = 0;
* 3. Bootstrapping of a hybrid Angular application which contains both of the frameworks * 3. Bootstrapping of a hybrid Angular application which contains both of the frameworks
* coexisting in a single application. * coexisting in a single application.
* *
* ## Mental Model * @usageNotes
* ### Mental Model
* *
* When reasoning about how a hybrid application works it is useful to have a mental model which * When reasoning about how a hybrid application works it is useful to have a mental model which
* describes what is happening and explains what is happening at the lowest level. * describes what is happening and explains what is happening at the lowest level.
@ -134,7 +135,8 @@ export class UpgradeAdapter {
* Angular Component. The adapter will bootstrap Angular component from within the * Angular Component. The adapter will bootstrap Angular component from within the
* AngularJS template. * AngularJS template.
* *
* ## Mental Model * @usageNotes
* ### Mental Model
* *
* 1. The component is instantiated by being listed in AngularJS template. This means that the * 1. The component is instantiated by being listed in AngularJS template. This means that the
* host element is controlled by AngularJS, but the component's view will be controlled by * host element is controlled by AngularJS, but the component's view will be controlled by
@ -146,7 +148,7 @@ export class UpgradeAdapter {
* by way of the `ControlValueAccessor` interface from @angular/forms. Only components that * by way of the `ControlValueAccessor` interface from @angular/forms. Only components that
* implement this interface are eligible. * implement this interface are eligible.
* *
* ## Supported Features * ### Supported Features
* *
* - Bindings: * - Bindings:
* - Attribute: `<comp name="World">` * - Attribute: `<comp name="World">`
@ -199,13 +201,14 @@ export class UpgradeAdapter {
* directive. The adapter will bootstrap AngularJS component from within the Angular * directive. The adapter will bootstrap AngularJS component from within the Angular
* template. * template.
* *
* ## Mental Model * @usageNotes
* ### Mental Model
* *
* 1. The component is instantiated by being listed in Angular template. This means that the * 1. The component is instantiated by being listed in Angular template. This means that the
* host element is controlled by Angular, but the component's view will be controlled by * host element is controlled by Angular, but the component's view will be controlled by
* AngularJS. * AngularJS.
* *
* ## Supported Features * ### Supported Features
* *
* - Bindings: * - Bindings:
* - Attribute: `<comp name="World">` * - Attribute: `<comp name="World">`
@ -283,6 +286,7 @@ export class UpgradeAdapter {
* Use this instead of `angular.mock.module()` to load the upgrade module into * Use this instead of `angular.mock.module()` to load the upgrade module into
* the AngularJS testing injector. * the AngularJS testing injector.
* *
* @usageNotes
* ### Example * ### Example
* *
* ``` * ```
@ -339,6 +343,7 @@ export class UpgradeAdapter {
* [`bootstrap`](https://docs.angularjs.org/api/ng/function/angular.bootstrap) method. Unlike * [`bootstrap`](https://docs.angularjs.org/api/ng/function/angular.bootstrap) method. Unlike
* AngularJS, this bootstrap is asynchronous. * AngularJS, this bootstrap is asynchronous.
* *
* @usageNotes
* ### Example * ### Example
* *
* ``` * ```
@ -412,7 +417,7 @@ export class UpgradeAdapter {
/** /**
* Allows AngularJS service to be accessible from Angular. * Allows AngularJS service to be accessible from Angular.
* *
* * @usageNotes
* ### Example * ### Example
* *
* ``` * ```
@ -452,7 +457,7 @@ export class UpgradeAdapter {
/** /**
* Allows Angular service to be accessible from AngularJS. * Allows Angular service to be accessible from AngularJS.
* *
* * @usageNotes
* ### Example * ### Example
* *
* ``` * ```
@ -481,6 +486,7 @@ export class UpgradeAdapter {
* @param modules The AngularJS modules that this upgrade module should depend upon. * @param modules The AngularJS modules that this upgrade module should depend upon.
* @returns The AngularJS upgrade module that is declared by this method * @returns The AngularJS upgrade module that is declared by this method
* *
* @usageNotes
* ### Example * ### Example
* *
* ``` * ```

View File

@ -32,11 +32,12 @@ class Bindings {
* A helper class that allows an AngularJS component to be used from Angular. * A helper class that allows an AngularJS component to be used from Angular.
* *
* *Part of the [upgrade/static](api?query=upgrade%2Fstatic) * *Part of the [upgrade/static](api?query=upgrade%2Fstatic)
* library for hybrid upgrade apps that support AoT compilation* * library for hybrid upgrade apps that support AoT compilation.*
* *
* This helper class should be used as a base class for creating Angular directives * This helper class should be used as a base class for creating Angular directives
* that wrap AngularJS components that need to be "upgraded". * that wrap AngularJS components that need to be "upgraded".
* *
* @usageNotes
* ### Examples * ### Examples
* *
* Let's assume that you have an AngularJS component called `ng1Hero` that needs * Let's assume that you have an AngularJS component called `ng1Hero` that needs

View File

@ -90,11 +90,11 @@ import {NgAdapterInjector} from './util';
* This class is an `NgModule`, which you import to provide AngularJS core services, * This class is an `NgModule`, which you import to provide AngularJS core services,
* and has an instance method used to bootstrap the hybrid upgrade application. * and has an instance method used to bootstrap the hybrid upgrade application.
* *
* #### Core AngularJS services * * Core AngularJS services
* Importing this `NgModule` will add providers for the core * Importing this `NgModule` will add providers for the core
* [AngularJS services](https://docs.angularjs.org/api/ng/service) to the root injector. * [AngularJS services](https://docs.angularjs.org/api/ng/service) to the root injector.
* *
* #### Bootstrap * * Bootstrap
* The runtime instance of this class contains a {@link UpgradeModule#bootstrap `bootstrap()`} * The runtime instance of this class contains a {@link UpgradeModule#bootstrap `bootstrap()`}
* method, which you use to bootstrap the top level AngularJS module onto an element in the * method, which you use to bootstrap the top level AngularJS module onto an element in the
* DOM for the hybrid upgrade app. * DOM for the hybrid upgrade app.