Skip to content
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(window): mocking window object #311

Merged
merged 1 commit into from
Mar 7, 2016
Merged

feat(window): mocking window object #311

merged 1 commit into from
Mar 7, 2016

Conversation

manekinekko
Copy link
Contributor

PR for #282


export var window = win;
global.window = win;
GLOBAL.window = win;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's GLOBAL?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in node, GLOBAL and global are equivalent
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I set those two justs in case :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like GLOBAL and root will be removed
nodejs/node#1838

@PatrickJS
Copy link
Member

kk merging

@antonbarada
Copy link

@gdi2290 how it works?
because I'm still getting error
ReferenceError: window is not defined

@antonbarada
Copy link

@gdi2290

@manekinekko
Copy link
Contributor Author

@thebarada please provide us with a working sample so we can reproduce your issue?

@PatrickJS
Copy link
Member

@thebarada if you're talking about Material error there's a workaround in the universal-starter. you can track this issue for window "support"
#534

@Xaiid
Copy link

Xaiid commented Oct 28, 2016

@gdi2290 I imported Ng1toNg2(Need Ng1toNg2 to make hybrid application routes works) module from ui-router, this requires angular 1.5.8 which uses window, and is throwing the error.

node_modules/angular/angular.js:31766
})(window);
^

ReferenceError: window is not defined`

Is Angular 1.5.8 going to be supported?

@PatrickJS
Copy link
Member

Angular 1.x.x is not supported for universal

@rsach
Copy link

rsach commented Apr 3, 2017

i'm trying to use masonry.js in universal starter pack with a 2.3 config
, is there any workaround sample that i can refer to
thanks in advance

Error:
/node_modules/masonry-layout/masonry.js:33
}( window, function factory( Outlayer, getSize ) {
^

ReferenceError: window is not defined
at Object. (

@sushrest
Copy link

Looks like its merged.. How to implement global window object for SSR. I am still getting undefined window error.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants