This repository was archived by the owner on Feb 26, 2024. It is now read-only.
add web-api.ts to patch mediaQuery#571
Merged
mhevery merged 1 commit intoangular:masterfrom Jan 12, 2017
Merged
Conversation
d1a84ee to
fafc29b
Compare
|
Great, thanks Could Web APIs have individual files though, as I need matchMedia now, but I don't necessarily want to include other APIs that might be added to that module in future. Also, is it best to have min and non-min versions? (I'm adding this into my build script, so need to know what it'll end up as) |
Collaborator
Author
|
@code-tree , yeah, I also considered how to separate the API into different files or modules, I'll do some research about how other API does, if you have some good ideas, please tell me, thank you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on the PR #543 and #549, I add a new file under lib/browser web-api.ts to patch mediaQuery, and other non-standard api later (for instance, notification API).
the patch in web-api will not be loaded by default, because those api are not supported by all browsers and versions, and it is difficult to tell whether the browser support it or not. So user should load web-api.js by themselves.
And because it is too difficult to test mediaQuery in jasmine,I only add the basic test case to see the prototype is patched or not.