From b90d899408a7d5fbe3d4a15e3fb2e1581cc539be Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Thu, 22 Oct 2015 23:34:16 -0700 Subject: [PATCH] doc(DynamicComponentLoader): update API doc --- .../core/linker/dynamic_component_loader.ts | 74 +++++++------------ 1 file changed, 25 insertions(+), 49 deletions(-) diff --git a/modules/angular2/src/core/linker/dynamic_component_loader.ts b/modules/angular2/src/core/linker/dynamic_component_loader.ts index 4af2ba1cc0..795fc711ed 100644 --- a/modules/angular2/src/core/linker/dynamic_component_loader.ts +++ b/modules/angular2/src/core/linker/dynamic_component_loader.ts @@ -106,36 +106,27 @@ export abstract class DynamicComponentLoader { * * Returns a promise for the {@link ComponentRef} representing the newly created Component. * - * * ### Example * * ``` - * @ng.Component({ - * selector: 'child-component' - * }) - * @ng.View({ + * @Component({ + * selector: 'child-component', * template: 'Child' * }) * class ChildComponent { * } * - * - * - * @ng.Component({ - * selector: 'my-app' - * }) - * @ng.View({ - * template: ` - * Parent () - * ` + * @Component({ + * selector: 'my-app', + * template: 'Parent ()' * }) * class MyApp { - * constructor(dynamicComponentLoader: ng.DynamicComponentLoader, injector: ng.Injector) { - * dynamicComponentLoader.loadAsRoot(ChildComponent, '#child', injector); + * constructor(dcl: DynamicComponentLoader, injector: Injector) { + * dcl.loadAsRoot(ChildComponent, '#child', injector); * } * } * - * ng.bootstrap(MyApp); + * bootstrap(MyApp); * ``` * * Resulting DOM: @@ -143,9 +134,7 @@ export abstract class DynamicComponentLoader { * ``` * * Parent ( - * - * Child - * + * Child * ) * * ``` @@ -166,35 +155,27 @@ export abstract class DynamicComponentLoader { * * Returns a promise for the {@link ComponentRef} representing the newly created Component. * - * * ### Example * * ``` - * @ng.Component({ - * selector: 'child-component' - * }) - * @ng.View({ + * @Component({ + * selector: 'child-component', * template: 'Child' * }) * class ChildComponent { * } * - * - * @ng.Component({ - * selector: 'my-app' - * }) - * @ng.View({ - * template: ` - * Parent (
) - * ` + * @Component({ + * selector: 'my-app', + * template: 'Parent (
)' * }) * class MyApp { - * constructor(dynamicComponentLoader: ng.DynamicComponentLoader, elementRef: ng.ElementRef) { - * dynamicComponentLoader.loadIntoLocation(ChildComponent, elementRef, 'child'); + * constructor(dcl: DynamicComponentLoader, elementRef: ElementRef) { + * dcl.loadIntoLocation(ChildComponent, elementRef, 'child'); * } * } * - * ng.bootstrap(MyApp); + * bootstrap(MyApp); * ``` * * Resulting DOM: @@ -224,29 +205,24 @@ export abstract class DynamicComponentLoader { * ### Example * * ``` - * @ng.Component({ - * selector: 'child-component' - * }) - * @ng.View({ + * @Component({ + * selector: 'child-component', * template: 'Child' * }) * class ChildComponent { * } * - * - * @ng.Component({ - * selector: 'my-app' - * }) - * @ng.View({ - * template: `Parent` + * @Component({ + * selector: 'my-app', + * template: 'Parent' * }) * class MyApp { - * constructor(dynamicComponentLoader: ng.DynamicComponentLoader, elementRef: ng.ElementRef) { - * dynamicComponentLoader.loadNextToLocation(ChildComponent, elementRef); + * constructor(dcl: DynamicComponentLoader, elementRef: ElementRef) { + * dcl.loadNextToLocation(ChildComponent, elementRef); * } * } * - * ng.bootstrap(MyApp); + * bootstrap(MyApp); * ``` * * Resulting DOM: