Тёмный

Beautiful Router Animations with Angular 

Fireship
Подписаться 3,3 млн
Просмотров 141 тыс.
50% 1

Create beautiful 🎨 page transitions with the Angular Router by building four different animation sequences from scratch fireship.io/le...
- Deal Crunch App play.google.co...
- Angular Router angular.io/gui...
- Angular Animations angular.io/gui...

Опубликовано:

 

12 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 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
@ikezedev
@ikezedev 5 лет назад
I'll need to re-watch this..... Thanks again Jeff
@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.
@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 :)
@-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.
@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
@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 ']'.
@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
@tl8990
@tl8990 2 года назад
Thanks for saving my class project by the due day. You are such a brilliant guy.
@sauravbhatt5426
@sauravbhatt5426 Год назад
thanku so much sir this tutorial help me so much thanku and love from INDIA
@ANUJGROVER01
@ANUJGROVER01 5 лет назад
Thank you for all such creative tutorials 🧡
@Fireship
@Fireship 5 лет назад
Thank you for watching :)
@MercyFromOverwatch2
@MercyFromOverwatch2 2 года назад
Jeff is my favourite tech youtuber
@robertomanganelly8725
@robertomanganelly8725 2 года назад
Simply wonderful. Thanks
@tobi-osimosu
@tobi-osimosu 2 года назад
Thanks for this video!
@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 :)
@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!
@ericnjanga3245
@ericnjanga3245 Год назад
Very helpful, thank you.
@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?
@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?
@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 4 года назад
Same here, did you ever resolve it?
@muhammadfirghi5009
@muhammadfirghi5009 4 года назад
Have you resolved this? I tried placing it all under one function, and tried to inject ForRoot and it still did not work
@akbaralimajeed
@akbaralimajeed 4 года назад
Excellent but Just relax man
@LarsRyeJeppesen
@LarsRyeJeppesen 4 года назад
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).
@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.
@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?
@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
@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.
@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
@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 :)
@ahmadartcraft9235
@ahmadartcraft9235 3 года назад
Awesome tutorial.... :)
@ameerpappay6782
@ameerpappay6782 5 лет назад
slider animation not working if consecutive routes has same animation left or right why its so?
@kokiiito
@kokiiito 5 лет назад
love this! thanks!
@saisreenivas2227
@saisreenivas2227 5 лет назад
Thanks for sharing lot of information
@avihusiso6888
@avihusiso6888 8 месяцев назад
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 ?
@space_monkey125
@space_monkey125 5 лет назад
Awesome video very helpful
@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.
@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
@swastikdas9169
@swastikdas9169 10 месяцев назад
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
@xenon4602
@xenon4602 4 года назад
does he make all of his videos like ctrl + z ?
@belabztech1055
@belabztech1055 4 года назад
Beautiful tutorial with sweet pace, shirt, smart and interesting, PS: I love your Editor Font, what font is please? Keep Rocking,
@AlekseyNew
@AlekseyNew 5 лет назад
Wow! Cool! Thanx!
@islamelsayed7263
@islamelsayed7263 2 года назад
Hello, why this error console (.Unable to process animations - returned zero elements ) !?
@will_abule
@will_abule 5 лет назад
terrific!
@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.
@ApexHighlightReels
@ApexHighlightReels 5 лет назад
It works very beautifully on development ... but does not work on production (ng s/b --prod)
@sagnikpradhan3594
@sagnikpradhan3594 5 лет назад
Here I am sitting and using ejs while seeing these kind of videos. LOL.
@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!
@cholasimmons
@cholasimmons Год назад
nothing worked for me, maybe coz I have nested routes?
@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!
@MarkStatkus
@MarkStatkus 3 года назад
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.
@jeremysistrunk3742
@jeremysistrunk3742 3 года назад
How do you ensure smooth animations using resolveGuard?
@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
@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 4 года назад
@@themindstorm9947 thanks
@surajankita1
@surajankita1 4 года назад
on default routing , animation not working?
@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 }), ])), ]) ]), ]) ]);
@imaliazhar
@imaliazhar 5 лет назад
What VS code theme are you using?
@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.
@ashrafkamal1806
@ashrafkamal1806 4 года назад
@Fireship will this work on ionic angular? ionic v4
@theobellash6440
@theobellash6440 5 лет назад
WooooWooonderfull
@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
@kellvivar
@kellvivar 5 лет назад
what is the Font of your editor?
@meenakshinegi
@meenakshinegi 5 лет назад
Thanks
@divinedela9125
@divinedela9125 5 лет назад
number 1
@Fireship
@Fireship 5 лет назад
🥈silver
@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 :/
@jorgenorena727
@jorgenorena727 4 года назад
Why so hurry? Please slow down...
@MedracZ
@MedracZ 4 года назад
Anyone else having issues with overflow when routing to a new page?
@sisterhood6022
@sisterhood6022 5 лет назад
Awesome content (thank you!). But why are you in **such** a hurry ALL-THE-TIME ;-) ?
@ciprianlupsa557
@ciprianlupsa557 4 года назад
The pace is too fast
@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 3 года назад
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)
@wisesa_dev
@wisesa_dev 5 лет назад
Hmmm nice
@NitrosS
@NitrosS 4 года назад
I´m in 0.75 speed
@ninipop82
@ninipop82 5 лет назад
These videos are good. But also very fast....
@Peleshoeloriginal
@Peleshoeloriginal 5 лет назад
Set the video speed to 0.5
@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".
@darshangowda309
@darshangowda309 5 лет назад
first :P
@Fireship
@Fireship 5 лет назад
🥇 gold
Далее
JavaScript Pro Tips - Code This, NOT That
12:37
Просмотров 2,5 млн
Angular Animations Tutorial | Mosh
32:59
Просмотров 157 тыс.
Faites comme moi
00:14
Просмотров 1,3 млн
Decompress small game, have time to play it!
00:35
Angular Components Beginner's Guide
13:52
Просмотров 186 тыс.
The Internet's most broken protocol
4:13
Просмотров 465 тыс.
80% of programmers are NOT happy… why?
4:43
Просмотров 1,2 млн
Advanced Angular Elements
11:46
Просмотров 64 тыс.
RxJS Top Ten - Code This, Not That
14:44
Просмотров 254 тыс.
The Async Await Episode I Promised
12:04
Просмотров 1,1 млн
Angular Router - The Basics and Beyond
11:47
Просмотров 129 тыс.
Cursor Is Beating VS Code (...by forking it)
18:00
Просмотров 92 тыс.