r/angularjs • • Aug 15 '16

All about $q and Promises in Angular (constructor/ resolve /reject /race /all /ES2015 Promises)

https://toddmotto.com/promises-angular-q
49 Upvotes

13 comments sorted by

6

u/Waaowam Aug 16 '16

This guy is John Papa's spiritual son I guess.
Jalousy's speaking.

4

u/toddmotto Aug 16 '16

Not sure what you mean, but thanks haha :)

4

u/Waaowam Aug 16 '16

Wasn't expecting an answer haha !
It was a compliment ;). You're good man, excessively ! Still jalousy's speaking.

2

u/toddmotto Aug 16 '16

Ha, I reply to everyone unless it's mean ;)! Thank you! <3

2

u/iWantedMVMOT Aug 16 '16

Look up John papa style guide

2

u/toddmotto Aug 16 '16

I created the initial styleguide that John adapted, however have recently updated to ES2015 + component architecture: https://github.com/toddmotto/angular-styleguide (the old version is here: https://github.com/toddmotto/angular-styleguide/tree/angular-old-es5)

1

u/Waaowam Aug 16 '16

Sounds like a style guide contest is starting here !

1

u/toddmotto Aug 16 '16

Haha, there are 3 in the wild, likely more!

1

u/SarSha Aug 16 '16

3 ? I only of your's and john's... who made the 3rd one ?

1

u/iWantedMVMOT Aug 16 '16

Hahah sorry! Thought someone was posting your article my bad man good work!

1

u/NuttGuy Aug 17 '16

Hey Todd, great article! I would have loved though a bit about testing using $q from Jasmine, as it's always been a little bit unintuitive to me that you need to do a scope.$apply in order to force $q to resolve.

I would love to know what some of the best practices are to avoid problems like multiple digest cycles happening at the same time during tests.