-
Notifications
You must be signed in to change notification settings - Fork 25.6k
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
feat(compiler): Add implementation for a XHR that uses a template cache to load template files. #7940
Conversation
cc @juliemr |
Is this just for testing? |
@laco0416 that's what the new compiller will do, will convert the templateUrl's in files intead of requesting them |
@ericmartinezr sounds good. thx! |
|
||
constructor() { | ||
super(); | ||
this._cache = (<any>window).$templateCache; |
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.
Don't use window
but the global
variable exported from angular2/src/facade/lang.ts
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.
Done.
…che to load template files. Useful for avoiding doing an actual XHR during testing. Part of the solution for #4051 (Other part is a Karma plugin that will create the template cache).
Merging PR #7940 on behalf of @alxhub to branch presubmit-alxhub-pr-7940. |
…che to load template files. Useful for avoiding doing an actual XHR during testing. Part of the solution for angular#4051 (Other part is a Karma plugin that will create the template cache). Closes angular#7940
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Feature - Provide a XHR implementation that uses a template cache to avoid actually making an XHR. Exports CACHED_TEMPLATE_PROVIDER through angular2/platform/browser and angular2/platform/testing/browser which can be used by applications and tests to use the cached XHR implementation.
Support preloading of templates, at least for testing #4051
If the application or test uses the cached XHR implementation by setting up the provider for XHR it will use the template cache instead of making an actual XHR. This can be useful for writing fakeAsync tests.
No
Useful for avoiding doing an actual XHR during testing.
Part of the solution for #4051 (Other part is a Karma plugin that will create the template cache).