Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { NgModule } from '@angular/core';
- import { CommonModule } from '@angular/common';
- @NgModule({
- imports: [
- CommonModule
- ],
- declarations: [],
- providers: [
- { provide: 'SQUARE', useFactory: getSquare }
- ]
- })
- export class SquareModule { }
- export function getSquare() {
- return (typeof window !== undefined)
- // TypeScript indicates it doesn't exist on Window
- ? window.SqPaymentForm
- : null;
- }
Add Comment
Please, Sign In to add comment