-
Notifications
You must be signed in to change notification settings - Fork 680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#113 Build URL to determine if request is cached #297
base: master
Are you sure you want to change the base?
Conversation
src/loading-bar.js
Outdated
var cache, | ||
defaultCache = $cacheFactory.get('$http'), | ||
defaults = $httpProvider.defaults, | ||
url = buildUrl(config.url, config.paramSerializer(config.params)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Single variable declaration per line please
Needs tests to support new feature |
Updated, with tests cover.
|
|
||
expect(cfpLoadingBar.status()).toBe 0 | ||
$timeout.flush() | ||
$timeout.flush() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are 2 timeout flushes necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question.
I must admit that I stupidly copied the structure from existing tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've got some really odd looking stuff in some of my tests, I wasn't criticising you.
Do the tests work if you remove one of them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay.
I've just tried removing one flush, but both are required to pass the tests (mine and yours).
I guess that two are enough to complete timeouts in _set
and _complete
.
FYI, I just pushed source code changes. Not builds. Do you need them now ?
@chieffancypants over to you |
+1! |
@chieffancypants needs your approval |
Sorry to be so late to the party. For clarification, does this feature simply not work with angular 1.4, or does it break the entire library's compatibility with earlier versions of angular? |
The feature is available with Angular 1.4 and later (which implements $httpParamSerializer) |
Hi @chieffancypants |
In response to #113, I added
buildUrl
from angular to determine if request is cached or not.