How to implement Swiper with Ionic 7 (ion-slides removed)

  Рет қаралды 28,008

Simon Grimm

Simon Grimm

Жыл бұрын

In this video, we will use the new Swiper element in an Ionic 7 app with Angular because ion-slides are finally removed!
🔥 The fastest way to learn Ionic: ionicacademy.com/
🪐 Explore web & mobile dev universe: galaxies.dev/
⚡️ Just getting started?
Grab a free 46 pages eBook: ionicacademy.com/ionic-quicks...
#############################
👨‍💻 Want to read instead of watch?
Here's the full Ionic tutorial: ionicacademy.com/swiper-ionic...
🤷‍♂️ Want more Ionic tutorials?
There you go: devdactic.com/
#############################
❤️ You can also find me on:
Instagram: / simongrimm_
Twitter: / schlimmson
Facebook: / devdactic
TikTok: / simongrimm_
Or join the Simonics Facebook group:
/ simonics
#############################

Пікірлер: 113
@galaxies_dev
@galaxies_dev Жыл бұрын
Learn to build epic IONIC apps FAST by joining the Ionic Academy: ionicacademy.com/
@promtermor
@promtermor 6 күн бұрын
Is it in @ionic/angular? 'cause i don't like react 🤮
@andersonantunes3287
@andersonantunes3287 Жыл бұрын
This is the video I was needing. Thanks Simon!!
@galaxies_dev
@galaxies_dev Жыл бұрын
Happy to help Anderson :)
@guleye
@guleye Жыл бұрын
I was waiting for that. Love you simon 💙
@galaxies_dev
@galaxies_dev Жыл бұрын
Thanks Muhammad 💪🏻
@williamscott3673
@williamscott3673 Жыл бұрын
Thanks a lot for the help. I had set it up into my project like normal but was struggling to find a good way to get a reference of it in typescript. Had no idea there was an `afterinit` event. Very helpful. Thanks a lot!
@galaxies_dev
@galaxies_dev Жыл бұрын
Happy I could help :)
@caiosales176
@caiosales176 Жыл бұрын
Awesome! Thanks a lot Simon!
@galaxies_dev
@galaxies_dev Жыл бұрын
Glad you liked it!
@simbaclaws_youtube
@simbaclaws_youtube 9 ай бұрын
Dear Simon, would you be kind enough to tell me how I can import a swiper-container and slide within a angular component? Because defining the schema and registering it in some page, doesn't allow me to use it within a angular component, how can I do this in a component? Do I need to register the swiper there somehow? Please let me know what I can do, I'm trying to migrate an app to ionic 7 from 6.
@andresfcuellarc
@andresfcuellarc 10 ай бұрын
Thanks a lot! as always save my day!
@galaxies_dev
@galaxies_dev 10 ай бұрын
Glad to hear that!
@supabitra
@supabitra 10 ай бұрын
Thanks a lot, Simon, for this video and all the other videos. It makes life easy for many like me. 🙏🙏 Can you kindly make one video with Swiper 10 as it seems a bit different than Swiper 9. Especially as seems no demos are available anywhere for the Ionic implementation of Swiper 10. Thanking you in advance.... 🙏🙏
@galaxies_dev
@galaxies_dev 10 ай бұрын
Great suggestion!
@townheadbluesboy
@townheadbluesboy Жыл бұрын
Great video Simon
@galaxies_dev
@galaxies_dev Жыл бұрын
Thanks 👍
@osroot
@osroot Жыл бұрын
hi, i started watching you recently, i got a bit confused, you still present projects with modules are still can be created with components not standalone ones, i am 6 months experience in ionic and i don't know what is better, standalone or modules in components, and if modules in components then how to do it because ionic and angular made the standalone structure is the default when creating a new project, i will grateful if you help me out Simon, thanks in advance..
@galaxies_dev
@galaxies_dev Жыл бұрын
Angular standalone components are probably the way to go in the future, so you should adapt that pattern. It's anyway not a huge change, just the place where you put stuff has changed a bit!
@ingjuliosg
@ingjuliosg 3 ай бұрын
Very well, thank you
@galaxies_dev
@galaxies_dev 3 ай бұрын
Welcome!
@user-yo5oz5td6h
@user-yo5oz5td6h 7 ай бұрын
sir how about if standalone? component MerchantPage is standalone, and cannot be declared in an NgModule. Did you mean to import it instead?
@saq.ib01
@saq.ib01 Жыл бұрын
Great as always. I have one request. how can we implement Deferred Deep linking in capacitor.
@smritimaygayen9609
@smritimaygayen9609 6 ай бұрын
Thank you 👍
@bastiencs4536
@bastiencs4536 Жыл бұрын
Great video Simon. For a reason I ignore, I had to write zoom="true" instead of [zoom]="true" to make the zoom works.
@galaxies_dev
@galaxies_dev Жыл бұрын
Strange but glad it works!
@mobileexpensys
@mobileexpensys Жыл бұрын
many thanks - I needed to do this too but only after reading your comment!
@nicholas1103
@nicholas1103 11 ай бұрын
thanks alot, zoom="true" solved my problem. i stuck this issue two hours. [zoom]="true" work with normal page, but not work when in modal.
@hannesg.3586
@hannesg.3586 5 ай бұрын
thank you. in modal it only works like this for me.
@user-eb2ip3qm8p
@user-eb2ip3qm8p Жыл бұрын
正是我们需要的,谢谢!!!😀
@wilsonhernandezortiz2472
@wilsonhernandezortiz2472 3 ай бұрын
Amazing!!
@galaxies_dev
@galaxies_dev 3 ай бұрын
Thanks!!
@rajtkbabu
@rajtkbabu Ай бұрын
Hi simon, how we can connect slides with ion-segment or tabs?
@ionwizard606
@ionwizard606 Жыл бұрын
Good work simon. Even in original swiper page we can't find a proper video about this
@galaxies_dev
@galaxies_dev Жыл бұрын
Glad it was helpful!
@tigerebevinmasevenza9761
@tigerebevinmasevenza9761 6 ай бұрын
I am using swiper 11.0.5 and the [loop]="true" is not working but l can still swipe the images is this a bug? Capacitor 5 on ionic 7
@SPACJuniorDeveloper
@SPACJuniorDeveloper 7 ай бұрын
slidechange function is not fired. Also is it possible to dynamically autoplay the slides, like a toggle button
@SPACJuniorDeveloper
@SPACJuniorDeveloper 7 ай бұрын
installing previous version of swiper worked for me: npm i swiper@9.3.2
@GosuMania
@GosuMania Жыл бұрын
Please can you do a video for Virtual slides of Swiper JS
@jp.moyacastillo
@jp.moyacastillo 10 ай бұрын
Hi Simon, thanks for your videos first! One question, which angular version are you using?
@galaxies_dev
@galaxies_dev 10 ай бұрын
I try to stick to the latest, but think it was 16 in this video!
@AbramxoAzul
@AbramxoAzul Жыл бұрын
I have a question, the properties of the swiper in the video are made in the html... how can I create them in my .ts and how can I call them in my swiper-container? thanks for the video !
@galaxies_dev
@galaxies_dev Жыл бұрын
I actually haven't found a good way to include a config like before, probably you have to init swiper completely from code then with a config object!
@venkateshprasathv8716
@venkateshprasathv8716 Жыл бұрын
I have doubts while i am creating a swiper slider in my project i can't edit swiper pagination active bullats how to change active color bullets kindly tell me bro please. I need it.
@emov
@emov Жыл бұрын
same problem, have a solution?
@MrAashish24
@MrAashish24 Жыл бұрын
Thanks a lot Simon!! I have one issue - I have updated Xcode and Safari technology preview. After updating, I am not able to inspect simulator and my connect IOS device. Can you please create one video in detail which will cover following points - 1. How to test ionic application using developer tools - (Network api calls, inspect the elements) 2. How to debug the application using Xcode in details (signing app etc.) 3. Android - How to debug and use chrome inspect in details. Please Please create video on this. Thanks in advance!!
@galaxies_dev
@galaxies_dev Жыл бұрын
Thank you Aashish, will see what I can do!
@shukridamit5723
@shukridamit5723 8 ай бұрын
Hi Simon, In SwiperJS 11, we can't set the parameter using [options]. Can you help on this?
@aishwaryamk6315
@aishwaryamk6315 3 ай бұрын
have u fond the solution?
@bander_wardi
@bander_wardi Жыл бұрын
Hello Simon, can I know the theme and font you are using in vs code. Thank you!
@galaxies_dev
@galaxies_dev Жыл бұрын
I am using Shades of Purple!
@lucaagnoli4373
@lucaagnoli4373 Жыл бұрын
Hey, thank you for your video. It was very helpful! I have a question. Can I have a swiper-container with two swiper-slide, one with scrolling, and the other one without scrolling I mean fixed?
@galaxies_dev
@galaxies_dev Жыл бұрын
Hmm maybe just make the whole swiper only 50% of the width if one part should be some fixed content anyway?
@lucaagnoli4373
@lucaagnoli4373 Жыл бұрын
@@galaxies_dev I made it work with overflow and touch-action CSS properties. But thanks for the answer, I really appreciate it. Greetings from Argentina.
@jeffersonestrada3668
@jeffersonestrada3668 Жыл бұрын
Gracias!
@galaxies_dev
@galaxies_dev Жыл бұрын
Encantado 🙌
@leocharrua_uy
@leocharrua_uy 11 ай бұрын
With the last version of swiper (10.0.4), I couldn't get to work the pan function (when zooming). Installing swiper 9.2.2 works ok.
@mortezakehtari888
@mortezakehtari888 Жыл бұрын
Hi Simon, I was wondering how we can add new slide after swiper initiates?
@galaxies_dev
@galaxies_dev Жыл бұрын
You should be able to set the datasource for swiper to a new array!
@user-se8md2hs2d
@user-se8md2hs2d Жыл бұрын
Dear friend, could you help me please? If i pass register() to appcomponent then previous/next buttons don’t work either. At the same time, I can scroll through it by dragging or pagination buttons… I really don’t understand how to make the previous/next buttons work normally. I also found a way to put register() in ngAfterViewInit in setTimeout or put it to some button click - it works, but I think it’s a bad option…
@jonathansimon7614
@jonathansimon7614 Жыл бұрын
What worked for me is updating to the latest ionic version and "downgrade" Swiper to the version 9.2.2, with that, everything worked for me like in the video.
@danielromero9577
@danielromero9577 Жыл бұрын
@@jonathansimon7614 Worked for me, thanks!
@kelubboy
@kelubboy Жыл бұрын
I an issue of slow page load due to massive number of components from components module Any idea on how to solve
@victorm9131
@victorm9131 Жыл бұрын
There could be a couple of problems here. It is hard to guess without the overview of the repo. 1. Try to split masive components into multiple smaller ones. Which use dumb-smart component pattern that would allow you to use OnPush Change detection. 2. Use lazy loading of other Modules and routes 3. App Component should be very lightweight. There shouldn’t be any logic. The logic has to be in the main Container component (smart) 4. When separating modules an loading them lazily, you could also benefit from Preload all module from the router. 5. Instead of having a masive Shared Module with declarations and exports, try to use SCAM (Single component per module) pattern and try to remove Shared Module entirely.
@codetalk0
@codetalk0 Жыл бұрын
Bro Do not working Next and prev Button Functionality In my case. My angular version 15 and swiper 9. please help me to do this .
@jonathansimon7614
@jonathansimon7614 Жыл бұрын
Are you using Ionic? I had the same problem but then I updated my Ionic to the latest version and switched to Swiper Version 9.2.2, now it works like in the video!
@mersalmohamed5493
@mersalmohamed5493 9 ай бұрын
swiper has an issue in loop if the elements less than sliderperview*2 is there any solution for this
@aishwaryamk6315
@aishwaryamk6315 3 ай бұрын
yes its happening did u find any solution?
@AdityaKumar-es6tx
@AdityaKumar-es6tx 9 ай бұрын
this is great and working but i am unable to move to next slide through slideNext and even slideTo is not working can you suggest any solution am using ionic with angular
@ronaldomartins3244
@ronaldomartins3244 9 ай бұрын
I wasn't getting it either. I included a settimeout in swiperReady() and this made a difference. swiperReady() { setTimeout(a => { this.swiper = this.swiperRef.nativeElement.swiper; }, 300, []); }
@lynxnunkima3872
@lynxnunkima3872 Жыл бұрын
Hello Simon, can you create Bluetooth Thermal printer app using ionic angular using firestore as backend or even just offline printing app please @SimonGrimm
@kshitijmall7325
@kshitijmall7325 5 ай бұрын
What about auto-play-delay
@goutamsingh3220
@goutamsingh3220 Жыл бұрын
what is your npm version & node version??
@galaxies_dev
@galaxies_dev Жыл бұрын
Node 16 and npm 8
@diegoAb
@diegoAb 10 ай бұрын
Swipper use uiwebview and apple deprecated that webview in store? Or not?
@galaxies_dev
@galaxies_dev 10 ай бұрын
No, Apple did not deprecate webviews. They are used in all apps, and only a specific type of "copycat" apps that only uses webviews was forbidden some years ago!
@diegoAb
@diegoAb 10 ай бұрын
@@galaxies_dev no webwiews, uiwebview, ITMS-90809: Deprecated API Usage - Apple will no longer accept submissions of new apps that use UIWebView as of April 30, 2020 and app updates that use UIWebView as of December 2020. Instead, use WKWebView for improved security and reliability
@diegoAb
@diegoAb 10 ай бұрын
@@galaxies_dev I meant that if swiper 10 uses uiwebview since I had swiper 8 in an app and when I wanted to upload an update Apple would not accept my app until I removed swiper from my application
@markusfurrer1202
@markusfurrer1202 Жыл бұрын
As soon as I import "import { register } from 'swiper/element/bundle';" I am getting an error: node_modules/swiper/element/swiper-element.d.ts:6:11 - error TS2430: Interface 'SwiperContainerEventMap' incorrectly extends interface 'HTMLElementEventMap'. using Ionic 7 and swiper 9. anyone an Idea?
@markusfurrer1202
@markusfurrer1202 Жыл бұрын
Solved it by downgrading from "swiper": "9.3.0", to "swiper": "9.2.4",
@ArielGarciaMarin
@ArielGarciaMarin 10 ай бұрын
what is the command o way to do it? Thank you in advanced @@markusfurrer1202
@hafeez-qalandari
@hafeez-qalandari Ай бұрын
Hello. Can we get the code for it plz!
@aaiz37
@aaiz37 Жыл бұрын
Any alternative solution for infinite scrolling ?
@galaxies_dev
@galaxies_dev Жыл бұрын
You should use the frameworks solution for infinite scroll!
@devsplanetng
@devsplanetng Жыл бұрын
If not how do i implement the swiper since I don't have module.ts to add the schema 😊
@67009
@67009 Жыл бұрын
same problem here too
@yurizem3325
@yurizem3325 Жыл бұрын
same mistake I created a component to control it but I can't use the swiper inside it since I don't have a product.component.modul
@chewbacca01
@chewbacca01 Жыл бұрын
How did you manage to start an ionic 7 project with angular without being standalone components?
@galaxies_dev
@galaxies_dev Жыл бұрын
They actually reverted that change, so should be easily possible right now!
@chewbacca01
@chewbacca01 Жыл бұрын
@@galaxies_dev Thanks
@jankocev276
@jankocev276 Жыл бұрын
Hi, is there any way to use *ngFor with swiper-slides?
@galaxies_dev
@galaxies_dev Жыл бұрын
Sure, should work just fine!
@jankocev276
@jankocev276 Жыл бұрын
@@galaxies_dev i'm sorry, I put the question wrong way, with ion-slides, I was using ng for to generate slides for every image in array and after user added/removed another image I could simple remove it/push it into array. this approach doesn't work. By swiper js documentation I have to call swiperRef.NativeElement.swiper.addSlide(index, stringHtml) and that leads to string html in my code (kinda ugly). is there some better way to get this dynamically generated slides? Also to use *ngFor i have to put swiper-slide template inside ng-container.
@chocolatejuiceify
@chocolatejuiceify 9 ай бұрын
@@jankocev276 Did you find a way to do this without using the html strings?
@jankocev276
@jankocev276 9 ай бұрын
@@chocolatejuiceify I did't, so i created my own component
@patricianieves8235
@patricianieves8235 10 ай бұрын
I have installed Swiper 10.2 and followed all the steps from the video, but even so, when I try to integrate Swiper into my HTML, I get an error: - error NG8001: 'swiper' is not a known element: [ng] 1. If 'swiper' is an Angular component, then verify that it is part of this module. [ng] 2. To allow any element, add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. [ng] 10 [ng] ~~~~~~~~ Can someone help me pls!!!
@galaxies_dev
@galaxies_dev 10 ай бұрын
I think for Swiper 10 the usage changed yet again -.-
@simbaclaws_youtube
@simbaclaws_youtube 9 ай бұрын
I think I'm having the same issue right now, is there any documentation anywhere on how to set this up on ionic 7?
@jared4670
@jared4670 Жыл бұрын
swiper doesn't seem to play well with ngfor.
@Newswapmedia
@Newswapmedia Жыл бұрын
I think ionic will dead soon in future because many plugins is outdated which was important to build app
@nemocode7941
@nemocode7941 Жыл бұрын
I'm not trust you. but I pushed subscribe button and like button. haha😝 And In ionic 7, xxxx.module.ts file is not found at startup, but you can put CUSTOM_ELEMENTS_SCHEMA in component.ts file. like this @Component({ ... schemas: [CUSTOM_ELEMENTS_SCHEMA] })
@galaxies_dev
@galaxies_dev Жыл бұрын
Yes, I have a separate video about those changes to Angular standalone modules as well!
@arunt9013
@arunt9013 8 ай бұрын
@@galaxies_dev we could not find that angular standalone video, could you please share the URL?
@user-eb2ip3qm8p
@user-eb2ip3qm8p Жыл бұрын
I have many pages that use switchers. Do I need to inject schemas: [CUSTOM.ELEMENTS_SCHEMA] into the modules of each page? Can I simply inject them in one place and use them directly on other pages?🤣
@galaxies_dev
@galaxies_dev Жыл бұрын
AS far as I understand you need it in all of the pages right now.
@user-eb2ip3qm8p
@user-eb2ip3qm8p Жыл бұрын
@@galaxies_dev Yes, can you add it?
@Crazycosmichild
@Crazycosmichild Жыл бұрын
hello the [config] its not working in the swiper-container tag??? i cant find the way to solve it id need to set the breakpoints but cant configure the config its not working
@galaxies_dev
@galaxies_dev Жыл бұрын
yeah haven't made config as an object work, but you can also set the properties directly like we did in the video!
@angrymayo1978
@angrymayo1978 10 ай бұрын
yea but somehow breakpoints throw an error, since property is a number based name. Having the same issue@@galaxies_dev
@lynxnunkima3872
@lynxnunkima3872 Жыл бұрын
Hello Simon, can you create Bluetooth Thermal printer app using ionic angular using firestore as backend or even just offline printing app please @SimonGrimm
How to use SQLite in Ionic with Capacitor
15:17
Simon Grimm
Рет қаралды 14 М.
Ionic 7 Swiper Slide using Swiper 9 (alternative of ion-slides)
21:45
Coding Technyks
Рет қаралды 11 М.
100❤️
00:19
MY💝No War🤝
Рет қаралды 11 МЛН
🤔Какой Орган самый длинный ? #shorts
00:42
ОСКАР vs БАДАБУМЧИК БОЙ!  УВЕЗЛИ на СКОРОЙ!
13:45
Бадабумчик
Рет қаралды 4,4 МЛН
Building an Ionic Searchable Select Component with Angular
28:36
Simon Grimm
Рет қаралды 11 М.
5 React Native Tips to WOW Your Users
16:36
Simon Grimm
Рет қаралды 15 М.
A New Way to DEBUG Ionic Apps 😱
9:04
Simon Grimm
Рет қаралды 9 М.
My Favorite Carousel Library | Swiper.js
5:23
John Komarnicki
Рет қаралды 14 М.
Ionic Image Zoom with Swiper
17:53
Simon Grimm
Рет қаралды 10 М.
Ionic 7 Routing with Angular Standalone Components
5:35
Simon Grimm
Рет қаралды 15 М.
How to use SwiperJS with Ionic (Swiper in Ionic Framework with React)
13:24
Angular 18 is EXACTLY what we needed
9:15
Academind
Рет қаралды 63 М.
Первый обзор Galaxy Z Fold 6
12:23
Rozetked
Рет қаралды 313 М.
После ввода кода - протирайте панель
0:18
Up Your Brains
Рет қаралды 1,2 МЛН
НЕ ПОКУПАЙ СМАРТФОН, ПОКА НЕ УЗНАЕШЬ ЭТО! Не ошибись с выбором…
15:23