New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can function be passed to transition method in animation_metadata or no? #18959

Closed
hisham opened this Issue Aug 30, 2017 · 1 comment

Comments

Projects
None yet
3 participants
@hisham

hisham commented Aug 30, 2017

I'm submitting a...


[X] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

Looks like I can no longer pass a function to transition method in animation_metadata.ts. Even though animation_metadata.ts still has this comment:

 *   // you can also go full out and include a function
 *   transition((fromState, toState) => {
 *     // when `true` then it will allow the animation below to be invoked
 *     return fromState == "off" && toState == "on";
 *   }, animate("1s 0s")) 

But transition method signature is now:

export declare function transition(stateChangeExpr: string, steps: AnimationMetadata | AnimationMetadata[], options?: AnimationOptions | null): AnimationTransitionMetadata;

Before commit 16c8167 made by @matsko @jasonaden it was:

export declare function transition(
    stateChangeExpr: string | ((fromState: string, toState: string) => boolean),
    steps: AnimationMetadata | AnimationMetadata[]): AnimationTransitionMetadata;
}

Expected behavior

Can a function still be used to determine if an animation should be run or not? Or are only state changes represented by a string supported now?

Minimal reproduction of the problem with instructions

This is a type definition issue, this commit removed the ability to pass a function to transition method but did not update the comments for that function: 16c8167?diff=split

What is the motivation / use case for changing the behavior?

My existing code that uses the transition method broke after upgrading to 4.3. Would like to know if this feature is supported in 4.3 or not.

Environment


Angular version: 4.3.6


@matsko

This comment has been minimized.

Show comment
Hide comment
@matsko

matsko Oct 31, 2017

Member

We are looking into re-introducing this in an Angular 5.x (1 or 2 or 3) release.

Member

matsko commented Oct 31, 2017

We are looking into re-introducing this in an Angular 5.x (1 or 2 or 3) release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment