Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

add web-api.ts to patch mediaQuery #571

Merged
merged 1 commit into from
Jan 12, 2017
Merged

Conversation

JiaLiPassion
Copy link
Collaborator

@JiaLiPassion JiaLiPassion commented Dec 31, 2016

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.

@mhevery mhevery merged commit e92f934 into angular:master Jan 12, 2017
@JiaLiPassion JiaLiPassion deleted the mediaquery branch January 12, 2017 01:24
@code-tree
Copy link

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)

@JiaLiPassion
Copy link
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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants