docs(animations): add documentation for new animation features

This commit is contained in:
Matias Niemelä
2017-04-25 15:06:31 -07:00
parent 5d4f5434fd
commit b10029c18b
7 changed files with 407 additions and 29 deletions

View File

@ -5,7 +5,7 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Animation, AnimationBuilder, AnimationMetadata, AnimationOptions, AnimationPlayer, NoopAnimationPlayer, sequence} from '@angular/animations';
import {AnimationBuilder, AnimationFactory, AnimationMetadata, AnimationOptions, AnimationPlayer, NoopAnimationPlayer, sequence} from '@angular/animations';
import {Injectable, RendererFactory2, RendererType2, ViewEncapsulation} from '@angular/core';
import {AnimationRenderer} from './animation_renderer';
@ -26,16 +26,16 @@ export class BrowserAnimationBuilder extends AnimationBuilder {
this._renderer = rootRenderer.createRenderer(document.body, typeData) as AnimationRenderer;
}
build(animation: AnimationMetadata|AnimationMetadata[]): Animation {
build(animation: AnimationMetadata|AnimationMetadata[]): AnimationFactory {
const id = this._nextAnimationId.toString();
this._nextAnimationId++;
const entry = Array.isArray(animation) ? sequence(animation) : animation;
issueAnimationCommand(this._renderer, null, id, 'register', [entry]);
return new BrowserAnimation(id, this._renderer);
return new BrowserAnimationFactory(id, this._renderer);
}
}
export class BrowserAnimation extends Animation {
export class BrowserAnimationFactory extends AnimationFactory {
constructor(private _id: string, private _renderer: AnimationRenderer) { super(); }
create(element: any, options?: AnimationOptions): AnimationPlayer {

View File

@ -5,5 +5,5 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export {BrowserAnimation as ɵBrowserAnimation, BrowserAnimationBuilder as ɵBrowserAnimationBuilder} from './animation_builder';
export {BrowserAnimationBuilder as ɵBrowserAnimationBuilder, BrowserAnimationFactory as ɵBrowserAnimationFactory} from './animation_builder';
export {AnimationRenderer as ɵAnimationRenderer, AnimationRendererFactory as ɵAnimationRendererFactory} from './animation_renderer';