Beautiful Router Animations with Angular

  Рет қаралды 141,941

Fireship

Fireship

Күн бұрын

Пікірлер: 122
@damianboryga1229
@damianboryga1229 4 жыл бұрын
I love that i don't have to spent 30mins on watching tutorial about how to install angular cli and all the basics when i just need what i'm searching for. Thank you
@TreyDubya
@TreyDubya 2 жыл бұрын
I've watched so many of your videos in the last 6 months as I've learned FE dev. And this helped me put the final touches on my portfolio site. Thank you so much.
@TreyDubya
@TreyDubya 2 жыл бұрын
​@@matiaslopez9915 I used components and routerLink and got it to work. Idk. I had to adjust the data: object from "left" and "right" to be numbered instead. Look at (and copy from) his repo, that really helped me.
@-0-__-0-
@-0-__-0- 2 жыл бұрын
Im a beginner in react and Ive always wondered how they're able to transition to a different route very smoothly. Thanks god I found this.
@ikezedev
@ikezedev 5 жыл бұрын
I'll need to re-watch this..... Thanks again Jeff
@reyco1
@reyco1 5 жыл бұрын
I needed this tutorial so bad, man! Came right in the nick of time too :)
@Fireship
@Fireship 5 жыл бұрын
Always great to hear that! Thanks Rey :)
@CharlesX711967
@CharlesX711967 5 жыл бұрын
Going to add this to my project at work, I'll mail you a percentage of my paycheck.
@Fireship
@Fireship 5 жыл бұрын
Lol, I'll be looking in the mail for that :)
@realsandeep
@realsandeep 4 жыл бұрын
@@Fireship Did you get the mail? Tell me what happend in 100 seconds
@zoecarlibur
@zoecarlibur 5 жыл бұрын
When you think you're an advanced Angular user, And then Jeff makes a video :-\
@LarsRyeJeppesen
@LarsRyeJeppesen 4 жыл бұрын
Back to feeling stupid again.. the life of a web developer
@minigeek
@minigeek 3 жыл бұрын
seriously dude
@MercyFromOverwatch2
@MercyFromOverwatch2 3 жыл бұрын
Jeff is my favourite tech youtuber
@tl8990
@tl8990 3 жыл бұрын
Thanks for saving my class project by the due day. You are such a brilliant guy.
@Tonycodes22
@Tonycodes22 5 жыл бұрын
I get this error but the animations still work. ``` core.js:15713 ERROR Error: Unable to process animations due to the following failed trigger transitions @routeAnimations has failed due to: - `query(":enter, :leave")` returned zero elements. (Use `query(":enter, :leave", { optional: true })` if you wish to allow this.) - `query(":enter")` returned zero elements. (Use `query(":enter", { optional: true })` if you wish to allow this.) - `query(":leave")` returned zero elements. (Use `query(":leave", { optional: true })` if you wish to allow this.) ```
@akshaykarajgikar3849
@akshaykarajgikar3849 4 жыл бұрын
Any luck getting it to work?
@alexandergerlach4579
@alexandergerlach4579 4 жыл бұрын
just add ', { optional: true }' (without the quotes) as the last argument of every query, right after ']'.
@ANUJGROVER01
@ANUJGROVER01 5 жыл бұрын
Thank you for all such creative tutorials 🧡
@Fireship
@Fireship 5 жыл бұрын
Thank you for watching :)
@tobi-osimosu
@tobi-osimosu 2 жыл бұрын
Thanks for this video!
@sauravbhatt5426
@sauravbhatt5426 2 жыл бұрын
thanku so much sir this tutorial help me so much thanku and love from INDIA
@ericnjanga3245
@ericnjanga3245 Жыл бұрын
Very helpful, thank you.
@okopyl
@okopyl 2 жыл бұрын
Thanks a lot for a great video. But the problem with this approach is that when you open a route for the first time, it slides from left or right, but what if I want it to slide only when I switch manually and not when I open them from the first time from URL? Basically, I need to cancel the animation if a user comes from the same route or just opened the route for the first time.
@kennethkwakye-gyamfi4765
@kennethkwakye-gyamfi4765 5 жыл бұрын
Slow down 😢
@LarsRyeJeppesen
@LarsRyeJeppesen 4 жыл бұрын
Play on 0.75x
@randomlee101
@randomlee101 Жыл бұрын
Lol I kept dragging it back. The video was helpful though
@shyagam
@shyagam 5 жыл бұрын
This doesn't seem to compile when building with *ng build --prod* . The AOT compiler doesn't like the *[direction]* key specification. A workaround is to create a function that returns the direction object: *export function* dir(direction: 'left' | 'right', value: *number* | *string* ) { *return* direction === 'left' ? { left: value } : { right: value }; } Then call it like so: *style(dir(direction, 0))* . Now it's possible to keep using the same animation function without duplicating it for each direction. ( ! ) Notice the *export* keyword as the AOT compiler requires it.
@ShaifulBorhan
@ShaifulBorhan 5 жыл бұрын
do you mind doing a pastebin of this? thanks
@ApexHighlightReels
@ApexHighlightReels 5 жыл бұрын
how do i call it with style(dir(direction, 0)) ? can you please share a blitz stack or something?
@robertomanganelly8725
@robertomanganelly8725 2 жыл бұрын
Simply wonderful. Thanks
@LarsRyeJeppesen
@LarsRyeJeppesen 5 жыл бұрын
ERROR in app/main/containers/app/app.component.ts(32,5): Error during template compile of 'AppComponent' Reference to a non-exported function in 'slider' 'slider' contains the error at app/main/containers/app/route-animations.ts(20,10).
@yassinekhe466
@yassinekhe466 4 жыл бұрын
thanks for the tuto but How I can use the same animation only between some components and not all of the application?
@8manjusha
@8manjusha 5 жыл бұрын
i implemented similar but routing animation works only on first route , on routing to same component again, the routing animation is not working
@avihusiso6888
@avihusiso6888 10 ай бұрын
a question.. when i apply the slide transition , some elements jump in the air untill the slide transition ends and then they jump back to their place.. how do i fix this ?
@narendrasinghrathore1012
@narendrasinghrathore1012 5 жыл бұрын
Great video on animations. Waiting something on dynamic components, ng-content, ng-container, content management in angular,( for.eg angular.io ) some advance angular concepts.
@carniattos
@carniattos 5 жыл бұрын
Awesome video!! Could this also be used with lazy loaded routes?
@Fireship
@Fireship 5 жыл бұрын
Yes, it should work with lazy routes out of the box :)
@ameerpappay6782
@ameerpappay6782 5 жыл бұрын
slider animation not working if consecutive routes has same animation left or right why its so?
@kamleshmerugu7621
@kamleshmerugu7621 5 жыл бұрын
Way to go, looking forward for some more awesome videos
@Juanmv05
@Juanmv05 5 жыл бұрын
When I use AOT in "ng build --aot=true", it shows an error: "Functions expressions are not supported in decorators in x references x. Consider changing the function expression into an exported function". But, when I change it to "export function", it shows the same error. Some ideas?
@LarsRyeJeppesen
@LarsRyeJeppesen 5 жыл бұрын
Same here, did you ever resolve it?
@muhammadfirghi5009
@muhammadfirghi5009 5 жыл бұрын
Have you resolved this? I tried placing it all under one function, and tried to inject ForRoot and it still did not work
@swastikdas9169
@swastikdas9169 Жыл бұрын
why dont you have word wrap turned on ? half my time was wasted just trying to figure out where the heck the slider came from
@CodingCatDev
@CodingCatDev 5 жыл бұрын
Beautiful job as always Jeff! I was just working on page flips for the same. Are there any suggestions on when to do animation work using CSS directly vs using Angular Animations?
@Fireship
@Fireship 5 жыл бұрын
I would use CSS for simple isolated animations like a button hover, but ng animations for things tied to the state of the app, i.e the router state.
@CodingCatDev
@CodingCatDev 5 жыл бұрын
@@user-if1de8pt2j oh that is interesting I will have to throw some Lorem Ipsum in and see what happens!
@Xenon77x
@Xenon77x 4 жыл бұрын
does he make all of his videos like ctrl + z ?
@akbaralimajeed
@akbaralimajeed 5 жыл бұрын
Excellent but Just relax man
@shaunb
@shaunb 5 жыл бұрын
I'm getting the following error that's preventing the animations from triggering: "query(":enter, :leave")` returned zero elements."
@Fireship
@Fireship 5 жыл бұрын
Add '{ optional: true }' to the query. I did not get that locally on the first animation, but that should fix it.
@shaunb
@shaunb 5 жыл бұрын
Thanks for the reply! It got rid of the error message, but the animations still do not fire.
@linkinbrr
@linkinbrr 5 жыл бұрын
@@shaunb Did you add the #outlet="outlet" at the router-outlet element? I was getting the same error, fixed it with that.
@shaunb
@shaunb 5 жыл бұрын
Ricardo Zanardo I confirmed that I have added that. Maybe it’s related to material?
@metalllus
@metalllus 5 жыл бұрын
@@shaunb same here, not working with site using angular material, did you find a solution?
@ApexHighlightReels
@ApexHighlightReels 5 жыл бұрын
It works very beautifully on development ... but does not work on production (ng s/b --prod)
@metalvarez1
@metalvarez1 5 жыл бұрын
is there a way to implement his on an ionic 4 app ? the official ionic docs don't mention any of this, and the documentation page of ion-router-outlet is pretty obscure, it just says that it supports animationBuilder animations, just that, not a word on hwo to implement it.
@LonliLokli
@LonliLokli 3 жыл бұрын
If you have eg 5 routes, all this isRight or isLeft will not work as you have to know both source and destination position on the screen
@sonoftroy8572
@sonoftroy8572 5 жыл бұрын
This is awesome! What can I do to get the deep understanding of code the way you do
@Fireship
@Fireship 5 жыл бұрын
Code everyday and try to build cool stuff :) Then try teach it by blogging or making videos
@MarkStatkus
@MarkStatkus 4 жыл бұрын
I tested this out.. chrome fairly smooth, other browsers 1 to 2 FPS. I wish there was a easier way to do this using GSAP or just straight CSS.
@ThiagoLucioBittencourt
@ThiagoLucioBittencourt 5 жыл бұрын
Good video, but...... talk to fast, don't show some pieces of code (imports too). But... It's a great video anyway. Thanks. In your Site, the write version solves this problem. One more point with total 10 :)
@islamelsayed7263
@islamelsayed7263 2 жыл бұрын
Hello, why this error console (.Unable to process animations - returned zero elements ) !?
@kokiiito
@kokiiito 5 жыл бұрын
love this! thanks!
@belabztech1055
@belabztech1055 4 жыл бұрын
Beautiful tutorial with sweet pace, shirt, smart and interesting, PS: I love your Editor Font, what font is please? Keep Rocking,
@cholasimmons
@cholasimmons Жыл бұрын
nothing worked for me, maybe coz I have nested routes?
@minigeek
@minigeek 3 жыл бұрын
someone tell this man to demonstrate live instead of coding by copy pasting.. it literally makes me think, I know nothing of angular :/
@ahmadartcraft9235
@ahmadartcraft9235 3 жыл бұрын
Awesome tutorial.... :)
@Agus013013
@Agus013013 4 жыл бұрын
I come from a plain JS background, I am just starting to build with AngularJS however this whole typescript and module stuff I don't know where to start. Would anyone point me in the right direction linking me to a resource, I want to start doing exactly what Jeff is doing on this video asap.
@space_monkey125
@space_monkey125 5 жыл бұрын
Awesome video very helpful
@saisreenivas2227
@saisreenivas2227 5 жыл бұрын
Thanks for sharing lot of information
@will_abule
@will_abule 5 жыл бұрын
terrific!
@AlekseyNew
@AlekseyNew 5 жыл бұрын
Wow! Cool! Thanx!
@sagnikpradhan3594
@sagnikpradhan3594 5 жыл бұрын
Here I am sitting and using ejs while seeing these kind of videos. LOL.
@JuanCruz-uk3qi
@JuanCruz-uk3qi 4 жыл бұрын
Hi, how can i add this transitions/animations to another routing ? I havnt got all the components in AppRoutingModule. Thanks!
@themindstorm9947
@themindstorm9947 5 жыл бұрын
Is anyone else getting this error? ERROR in app/app.component.ts(20,5): Error during template compile of 'AppComponent' Function calls are not supported in decorators but 'slideTo' was called in 'slider' 'slider' calls 'slideTo'.
@themindstorm9947
@themindstorm9947 5 жыл бұрын
I have a quick fix for anyone experiencing the same issues: - create three variables: optional, toTheLeft, and toTheRight - assign these variables instead of the slideTo('left') or slideTo('right') functions See the full code here: pastebin.com/H1CKMvw5
@otaviofrank5902
@otaviofrank5902 5 жыл бұрын
@@themindstorm9947 Thank you!
@HelpUsBelieve
@HelpUsBelieve 5 жыл бұрын
@@themindstorm9947 Thanks
@LarsRyeJeppesen
@LarsRyeJeppesen 5 жыл бұрын
@@themindstorm9947 thanks
@surajankita1
@surajankita1 4 жыл бұрын
on default routing , animation not working?
@jeremysistrunk3742
@jeremysistrunk3742 3 жыл бұрын
How do you ensure smooth animations using resolveGuard?
@theyja1
@theyja1 3 жыл бұрын
that last stepper animation not working for me please help me! animations:[ fader, slider, transformer, stepper, ], app.routing.modules -> data:{animation:'isRight'} route-animation-> export const stepper = trigger('routeAnimations', [ transition('* *', [ query(':enter, :leave', [ style({ position: 'absolute', left: 0, width: '100%', }), ]), group([ query(':enter', [ animate('2000ms ease', keyframes([ style({ transform: 'scale(0) translateX(100%)', offset: 0 }), style({ transform: 'scale(0.5) translateX(25%)', offset: 0.3 }), style({ transform: 'scale(1) translateX(0%)', offset: 1 }), ])), ]), query(':leave', [ animate('2000ms ease', keyframes([ style({ transform: 'scale(1)', offset: 0 }), style({ transform: 'scale(0.5) translateX(-25%) rotate(0)', offset: 0.35 }), style({ opacity: 0, transform: 'translateX(-50%) rotate(-180deg) scale(6)', offset: 1 }), ])), ]) ]), ]) ]);
@meenakshinegi
@meenakshinegi 5 жыл бұрын
Thanks
@divinedela9125
@divinedela9125 5 жыл бұрын
number 1
@Fireship
@Fireship 5 жыл бұрын
🥈silver
@NitrosS
@NitrosS 5 жыл бұрын
I´m in 0.75 speed
@ashrafkamal1806
@ashrafkamal1806 4 жыл бұрын
@Fireship will this work on ionic angular? ionic v4
@MedracZ
@MedracZ 4 жыл бұрын
Anyone else having issues with overflow when routing to a new page?
@Skylark9704
@Skylark9704 5 жыл бұрын
what if your router outlet is not in app-component?
@alexandergerlach4579
@alexandergerlach4579 4 жыл бұрын
mine is in header component cause my header wraps the whole app because of angular-material. i just put all the logic in the header.ts file and it works.
@jorgenorena727
@jorgenorena727 5 жыл бұрын
Why so hurry? Please slow down...
@theobellash6440
@theobellash6440 5 жыл бұрын
WooooWooonderfull
@barjosa31blogspot83
@barjosa31blogspot83 5 жыл бұрын
It would be great if you just slow down a litttle bit while speaking and moving on. Will appreciate this! Still, deserved like!
@kellvivar
@kellvivar 5 жыл бұрын
what is the Font of your editor?
@Boilinglemon
@Boilinglemon 5 жыл бұрын
Hi Jeff, I've followed your tutorial and the animations work great when using ng serve, but when I try to ng build --prod, I get this error: ERROR in src\app ecipe-builder ecipe-builder.component.ts(9,16): Error during template compile of 'RecipeBuilderComponent' Reference to a non-exported function in 'slider' 'slider' contains the error at src\app ecipe-builder oute-animations.ts(37,10) Any idea why this might be the case for building to production? Thanks
@romaincrevecoeur5952
@romaincrevecoeur5952 5 жыл бұрын
I have the issue if you happen to fix it
@HelpUsBelieve
@HelpUsBelieve 5 жыл бұрын
This is happening to me as well.
@Boilinglemon
@Boilinglemon 5 жыл бұрын
Romain Crevecoeur I still haven’t fixed it, I’ve just been building without -prod 😕
@romaincrevecoeur5952
@romaincrevecoeur5952 5 жыл бұрын
I did animations with CSS instead. It's not totally what i exepected but it's good enough
@wisesa_dev
@wisesa_dev 5 жыл бұрын
Hmmm nice
@sisterhood6022
@sisterhood6022 5 жыл бұрын
Awesome content (thank you!). But why are you in **such** a hurry ALL-THE-TIME ;-) ?
@ankitabhatt4359
@ankitabhatt4359 4 жыл бұрын
Can anybody please help me out . I am facing this error `query(":enter")` returned zero elements. (Use `query(":enter", { optional: true })` if you wish to allow this.)
@Mike-qg1we
@Mike-qg1we 4 жыл бұрын
Hi, yesterday I've been struggling with these errors - what helped me was changing this -> [@routeAnimations]="prepareRoute(outlet)" into that -> [@fadeInAnimation]="outlet.isActivated ? outlet.activatedRoute : ''" and discarding the function. I know this will leave you with only one animation for route change but this was my goal anyway, and you always can wrap it in a function. Hope someone will find this helpful ;) (btw fadeInAnimation is what my animation is called in route-animations.ts)
@ciprianlupsa557
@ciprianlupsa557 5 жыл бұрын
The pace is too fast
@imaliazhar
@imaliazhar 5 жыл бұрын
What VS code theme are you using?
@marcellokabora
@marcellokabora 5 жыл бұрын
Looks very complex :(
@veshrajjoshi1
@veshrajjoshi1 4 жыл бұрын
Content is very useful, appreciate it. One suggestion - make video slower which would be more effective. You are in fast-forward mode and sounds like "lfjdkljfsldflskdjfklsdjfl".
@ninipop82
@ninipop82 5 жыл бұрын
These videos are good. But also very fast....
@Peleshoeloriginal
@Peleshoeloriginal 5 жыл бұрын
Set the video speed to 0.5
@darshangowda309
@darshangowda309 5 жыл бұрын
first :P
@Fireship
@Fireship 5 жыл бұрын
🥇 gold
I built the same app 10 times // Which JS Framework is best?
21:58
Fireship
Рет қаралды 2,6 МЛН
Make Awesome SVG Animations with CSS // 7 Useful Techniques
12:20
UFC 308 : Уиттакер VS Чимаев
01:54
Setanta Sports UFC
Рет қаралды 909 М.
ЛУЧШИЙ ФОКУС + секрет! #shorts
00:12
Роман Magic
Рет қаралды 21 МЛН
HELP!!!
00:46
Natan por Aí
Рет қаралды 37 МЛН
😜 #aminkavitaminka #aminokka #аминкавитаминка
00:14
Аминка Витаминка
Рет қаралды 2,6 МЛН
Reactive Forms  - The Basics
15:48
Fireship
Рет қаралды 257 М.
25 crazy software bugs explained
16:50
Fireship
Рет қаралды 593 М.
The most dystopian app ever made…
4:54
Fireship
Рет қаралды 974 М.
Angular 17 Features With Examples - You Must Know That
14:44
Monsterlessons Academy
Рет қаралды 39 М.
Award Winning Animation With Only 20 Lines Of CSS?
6:59
Hyperplexed
Рет қаралды 1,8 МЛН
5 Angular Animations Examples - Learn BrowserAnimationsModule in Angular
17:55
Monsterlessons Academy
Рет қаралды 35 М.
JavaScript Pro Tips - Code This, NOT That
12:37
Fireship
Рет қаралды 2,5 МЛН
Enums considered harmful
9:23
Matt Pocock
Рет қаралды 210 М.
Front-end web development is changing, quickly
3:43
Fireship
Рет қаралды 1,3 МЛН
Incredible scroll-based animations with CSS-only
32:23
Kevin Powell
Рет қаралды 463 М.
UFC 308 : Уиттакер VS Чимаев
01:54
Setanta Sports UFC
Рет қаралды 909 М.