Better way to convert angular animation callback into observable?
up vote
1
down vote
favorite
I have an angular animation, that has a callback when it completes:
<section [@routerTransition]="getAnimation()" (@routerTransition.done)="transitionEnd($event)">
</section>
I'm currently handling that event, and emitting from an EventEmitter:
private transitionCompleted$: EventEmitter<null> = new EventEmitter();
transitionEnd() {
this.transitionCompleted$.emit();
}
transitionCompleted$
is an observable (EventEmitter
is a subclass of observable) that emits when the transition completes.
Is there a better/more straightforward way to convert that callback into an observable?
What I don't like is having to handle that event, only to create a new event.
Something like this.transitionCompleted$ = @ViewChild('@routerTransition').done
...
angular rxjs observable
add a comment |
up vote
1
down vote
favorite
I have an angular animation, that has a callback when it completes:
<section [@routerTransition]="getAnimation()" (@routerTransition.done)="transitionEnd($event)">
</section>
I'm currently handling that event, and emitting from an EventEmitter:
private transitionCompleted$: EventEmitter<null> = new EventEmitter();
transitionEnd() {
this.transitionCompleted$.emit();
}
transitionCompleted$
is an observable (EventEmitter
is a subclass of observable) that emits when the transition completes.
Is there a better/more straightforward way to convert that callback into an observable?
What I don't like is having to handle that event, only to create a new event.
Something like this.transitionCompleted$ = @ViewChild('@routerTransition').done
...
angular rxjs observable
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have an angular animation, that has a callback when it completes:
<section [@routerTransition]="getAnimation()" (@routerTransition.done)="transitionEnd($event)">
</section>
I'm currently handling that event, and emitting from an EventEmitter:
private transitionCompleted$: EventEmitter<null> = new EventEmitter();
transitionEnd() {
this.transitionCompleted$.emit();
}
transitionCompleted$
is an observable (EventEmitter
is a subclass of observable) that emits when the transition completes.
Is there a better/more straightforward way to convert that callback into an observable?
What I don't like is having to handle that event, only to create a new event.
Something like this.transitionCompleted$ = @ViewChild('@routerTransition').done
...
angular rxjs observable
I have an angular animation, that has a callback when it completes:
<section [@routerTransition]="getAnimation()" (@routerTransition.done)="transitionEnd($event)">
</section>
I'm currently handling that event, and emitting from an EventEmitter:
private transitionCompleted$: EventEmitter<null> = new EventEmitter();
transitionEnd() {
this.transitionCompleted$.emit();
}
transitionCompleted$
is an observable (EventEmitter
is a subclass of observable) that emits when the transition completes.
Is there a better/more straightforward way to convert that callback into an observable?
What I don't like is having to handle that event, only to create a new event.
Something like this.transitionCompleted$ = @ViewChild('@routerTransition').done
...
angular rxjs observable
angular rxjs observable
asked Nov 9 at 10:55
K. Gkinis
1,2241230
1,2241230
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
No, unfortunately there is no better way to do that at this point in time. They are currently working on a solution.
You can follow the progress of this issue here.
Thank you, did not even know the terminology (cold event streams) 🙂
– K. Gkinis
Nov 9 at 11:01
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
No, unfortunately there is no better way to do that at this point in time. They are currently working on a solution.
You can follow the progress of this issue here.
Thank you, did not even know the terminology (cold event streams) 🙂
– K. Gkinis
Nov 9 at 11:01
add a comment |
up vote
1
down vote
accepted
No, unfortunately there is no better way to do that at this point in time. They are currently working on a solution.
You can follow the progress of this issue here.
Thank you, did not even know the terminology (cold event streams) 🙂
– K. Gkinis
Nov 9 at 11:01
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
No, unfortunately there is no better way to do that at this point in time. They are currently working on a solution.
You can follow the progress of this issue here.
No, unfortunately there is no better way to do that at this point in time. They are currently working on a solution.
You can follow the progress of this issue here.
answered Nov 9 at 10:59
ggradnig
2,200317
2,200317
Thank you, did not even know the terminology (cold event streams) 🙂
– K. Gkinis
Nov 9 at 11:01
add a comment |
Thank you, did not even know the terminology (cold event streams) 🙂
– K. Gkinis
Nov 9 at 11:01
Thank you, did not even know the terminology (cold event streams) 🙂
– K. Gkinis
Nov 9 at 11:01
Thank you, did not even know the terminology (cold event streams) 🙂
– K. Gkinis
Nov 9 at 11:01
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53224365%2fbetter-way-to-convert-angular-animation-callback-into-observable%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown