Тёмный

How, Why, and When to Use Providers in Ionic 

Joshua Morony
Подписаться 74 тыс.
Просмотров 31 тыс.
50% 1

In this video tutorial, I walk through a simple of example of when it would make sense to create a provider in Ionic and how to do it.
Blog post: www.joshmorony.com/how-why-an...
Learn Ionic: www.joshmorony.com/building-m...

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

 

29 янв 2017

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 29   
@markellis7712
@markellis7712 7 лет назад
Very helpful explaining "why" to use a provider AND showing how. Thanks for the great tutorial!
@andydorman4695
@andydorman4695 7 лет назад
Excellent work! Showing the first way without a provider and then refactoring to use a provider made it very clear why a provider is a good idea. I also expect using a provider will make testing easier as well. Based on this I have purchased your ebook package. Thank you.
@FieelFlying
@FieelFlying 6 лет назад
Thank you so much, well made videos (with actual explanations, not just do A then do B) about Ionic are kinda rare
@Mr_BetaMax
@Mr_BetaMax 7 лет назад
I really enjoy your videos. Thank you for the helpful tutorials! :)
@JoshuaMorony
@JoshuaMorony 7 лет назад
You're welcome :)
@NormGlomski
@NormGlomski 7 лет назад
Thanks Josh for another very helpful video. I really need to start moving the heavy lifting code out of my page classes.
@vishnurapposol4698
@vishnurapposol4698 7 лет назад
Good work. Thank you
@brianivandertp
@brianivandertp 5 лет назад
Thank you so much Josh
@entertainmentstudying1617
@entertainmentstudying1617 6 лет назад
thanks very much , its working for me :)
@saidelghamri2947
@saidelghamri2947 6 лет назад
Thank You good tutorial
@marcusviniciussilvaoliveir1533
thanks, this helped me.
@obeydadjeffal4442
@obeydadjeffal4442 7 лет назад
Nice tutorials, could you do an ionic 2 offline first tutorial?
@manukorn5823
@manukorn5823 6 лет назад
Thank you good video!
@laurisilva4092
@laurisilva4092 7 лет назад
Joshua congratulations!! It would be great a bit of FireBase a big hug
@AnthonyRamtulla
@AnthonyRamtulla 6 лет назад
Very good tutorial. Consider doing an example with SQLite
@yusadolat
@yusadolat 7 лет назад
Thanks for this Great tutorial Josh, One Issue the data i passes to second page log Undefined. I'm i doing something wrong?
@pedrodurek
@pedrodurek 7 лет назад
Hi Joshua, how do you generate indexed suffixes for post variable? Is it a sublime plugin or a native tool from sublime?
@kejianxin9735
@kejianxin9735 7 лет назад
Nice
@emmanuelogoma2595
@emmanuelogoma2595 6 лет назад
hello, how can u access the post variable in app.html
@kanagavel3121
@kanagavel3121 6 лет назад
how to check all field is empty in login from using ionic 2? please tell me.
@moncefkho
@moncefkho 7 лет назад
i don't like directly using the service in the template, why not create a page component local variable and assign to it the load() result.
@JoshuaMorony
@JoshuaMorony 7 лет назад
It depends on the context but in general, I prefer accessing through the provider directly, it can make the code a lot simpler. For example, if I assigned the result of the load method to a variable in the page, and then later update add or delete some item, I need to make sure I update the local reference in the page as well (perhaps directly or I could have an observable set up). If the template is accessing the provider directly then you don't need to worry about any of that, as soon as the provider updates the template will.
@sameeragayan9092
@sameeragayan9092 7 лет назад
I was about to ask the same question, Nice answer Josh. I see your point. All this time I was following what khocef is doing. Thanks a lot for the nice tutorials, they are really helpful :) cheers
@reneramirez412
@reneramirez412 2 года назад
How can I use providers in ionic 6?
@paulonelsonm
@paulonelsonm 7 лет назад
Uncaught (in promise): Error: No provider for Http! Error at Error (native) at g (localhost:8100/build/polyfills.js:3:7133) at injectionError (localhost:8100/build/main.js:1511:86) at noProviderError (localhost:8100/build/main.js:1549:12) at ReflectiveInjector_._throwOrNull (localhost:8100/build/main.js:3051:19) at ReflectiveInjector_._getByKeyDefault (localhost:8100/build/main.js:3090:25) at ReflectiveInjector_._getByKey (localhost:8100/build/main.js:3022:25) at ReflectiveInjector_.get (localhost:8100/build/main.js:2891:21) at NgModuleInjector.get (localhost:8100/build/main.js:3856:52) at resolveDep (localhost:8100/build/main.js:11260:45) at createClass (localhost:8100/build/main.js:11117:35) at _createProviderInstance (localhost:8100/build/main.js:11086:17) at createProviderInstance (localhost:8100/build/main.js:10927:64) at createViewNodes (localhost:8100/build/main.js:12293:49) at createRootView (localhost:8100/build/main.js:12208:5)
@mohammedalshaalan6957
@mohammedalshaalan6957 7 лет назад
Have you removed the Http provider from the constructor?
@michaelibrahim8360
@michaelibrahim8360 7 лет назад
محمد شعلانBut what if I need to use the http provider in the Posts provider ?! Why do we have to remove it to work !?
@mohammedalshaalan6957
@mohammedalshaalan6957 7 лет назад
you can have both, but you need to import http the proper way before using it, otherwise u will get the same err.
@michaelibrahim8360
@michaelibrahim8360 7 лет назад
So how should I import http in a provider ?!
Далее
The mindset you need for a DECLARATIVE code refactor
7:56
Dynamic Theming Your Ionic App
13:32
Просмотров 15 тыс.
Custom Ionic Splash + Animation
5:29
Просмотров 175 тыс.
How Angular plans to survive the next 10 years
3:40
Просмотров 13 тыс.
A "hidden" side benefit of DECLARATIVE code
5:08
Просмотров 6 тыс.
Observables are WAY easier than they seem
3:28
Просмотров 7 тыс.
This made me NOT hate note taking (as a developer)
7:23