the importance of scope.apply() when testing promises
“remember kids, Jasmine likes to apply” …sorry, what? Well, basically, it’s simple: when writing unit tests on promises with Jasmine, remember to call $scope.apply(), it will save you some headaches! take a look at this AngularJs controller. Look at it. <span class=pl-k>var</span> <span class=pl-s1>myApp</span> <span class=pl-c1>=</span> <span class=pl-s1>angular</span><span class=pl-kos>.</span><span class=pl-en>module</span><span...
2015, Nov 10 — 5 minute read