Guest User

Untitled

a guest
May 22nd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. import { NgModule } from '@angular/core';
  2. import { CommonModule } from '@angular/common';
  3.  
  4. @NgModule({
  5. imports: [
  6. CommonModule
  7. ],
  8. declarations: [],
  9. providers: [
  10. { provide: 'SQUARE', useFactory: getSquare }
  11. ]
  12. })
  13. export class SquareModule { }
  14.  
  15. export function getSquare() {
  16. return (typeof window !== undefined)
  17. // TypeScript indicates it doesn't exist on Window
  18. ? window.SqPaymentForm
  19. : null;
  20. }
Add Comment
Please, Sign In to add comment