You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Card.js is throwing errors in Angular 6 which makes it unusable.
ERROR ReferenceError: global is not defined at Card.js:205 at construct (Card.js:210) at Card (Card.js:364) at Object.Stack.stack.createCard (Stack.js:81) at SwingStackComponent.push../node_modules/angular2-swing/dist/swing-stack-component.js.SwingStackComponent.addCard (swing-stack-component.js:24) at SwingCardComponent.push../node_modules/angular2-swing/dist/swing-card-component.js.SwingCardComponent.ngOnInit (swing-card-component.js:12) at checkAndUpdateDirectiveInline (core.js:10097) at checkAndUpdateNodeInline (core.js:11363) at checkAndUpdateNode (core.js:11325) at debugCheckAndUpdateNode (core.js:11962)
The text was updated successfully, but these errors were encountered:
There are 2 ways to fix this : #1. You can either add these following lines in the < head > element of your index.html:
<script>
if (global === undefined) {
var global = window;
}
</script>
#2. A cleaner fix would be to add this line as the first line in the polyfills.ts file :
(window as any).global = window;
This issue started with the release of angular5 as the app tries to refer to the window element ( in this case , from Card.js ) before angular attaches the 'global' variable to it.
Card.js is throwing errors in Angular 6 which makes it unusable.
ERROR ReferenceError: global is not defined at Card.js:205 at construct (Card.js:210) at Card (Card.js:364) at Object.Stack.stack.createCard (Stack.js:81) at SwingStackComponent.push../node_modules/angular2-swing/dist/swing-stack-component.js.SwingStackComponent.addCard (swing-stack-component.js:24) at SwingCardComponent.push../node_modules/angular2-swing/dist/swing-card-component.js.SwingCardComponent.ngOnInit (swing-card-component.js:12) at checkAndUpdateDirectiveInline (core.js:10097) at checkAndUpdateNodeInline (core.js:11363) at checkAndUpdateNode (core.js:11325) at debugCheckAndUpdateNode (core.js:11962)
The text was updated successfully, but these errors were encountered: