Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

ngDocs: angular.mock.dump is not injected to window #14790

Closed
e-cloud opened this issue Jun 16, 2016 · 5 comments
Closed

ngDocs: angular.mock.dump is not injected to window #14790

e-cloud opened this issue Jun 16, 2016 · 5 comments

Comments

@e-cloud
Copy link

e-cloud commented Jun 16, 2016

https://docs.angularjs.org/api/ngMock/function/angular.mock.dump

the docs now implys dump function is available on window. it's not true

@Narretz
Copy link
Contributor

Narretz commented Jun 16, 2016

Hm, I'm using it pretty often. Are you sure you have the ngMock module included when you try to call it?

@gkalpak
Copy link
Member

gkalpak commented Jun 16, 2016

@Narretz, you probably mean that it is available as window.angular.mock.dump, but @e-cloud is right: it is not available on window (window.dump) as documented.

Bug or docs issue ?
Since it isn't necessary on window, let's fix the docs to avoid breaking tests where window.dump is defined by the developer.

@wesleycho
Copy link
Contributor

There are some situations I've found where not all ngMock globals are not truly published to window, mainly when transpilers like TypeScript or Babel are involved.

When using TypeScript, I've found that I've had to use angular.mock.module, but strangely inject worked fine.

@gkalpak
Copy link
Member

gkalpak commented Jun 16, 2016

This is different though. We are not publishing angular.mock.dump on window, so transpilers are hardly to blame :)

I can see why module would get overwritten with transpilers that try to support CommonJS and put things on module.exports 😃

@wesleycho
Copy link
Contributor

Ah, I mistook the issue...and that makes sense, I think I knew that but forgot - sorry for the diversion!

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

No branches or pull requests

4 participants