Add promise-able search function (fixes #34, #35)#58
Add promise-able search function (fixes #34, #35)#58ace-han wants to merge 1 commit intodjett41:masterfrom
Conversation
|
Hey, very nice! I have just one question. I want to show loader before call my API but it doesn't work. My code looks like this: in my console I can see 'search' is logged immediately but the property showLoading is true after deffered.resolve is called. Absolutely don't understand why :( Thanks for any help |
|
@balicekt It's likely a typo. Just replace $scope. |
|
@ace-han thank you for you answer. searchLoading = false is commented it not about it. It is about $scope.showLoading = true; because $scope.showLoading get true after deferred.resolve is called. It means is for nothing because I need to show spinner before it finish :( It means the loading spinner is never shown because it get false in the same time like get true (when I change scope.searchLoading to scope.showLoading and uncomment this line) |
Based on #35 , make the return value from
searchfunction promise-able