Skip to content
Permalink
Browse files

fix(angular): add double initialize warning (#19393)

  • Loading branch information...
manucorporat committed Sep 20, 2019
1 parent 123d0f3 commit e98769edd0473b7bdd17d51dd8b00bdc057ebdfb
Showing with 6 additions and 0 deletions.
  1. +6 −0 angular/src/app-initialize.ts
@@ -5,10 +5,16 @@ import { Config } from './providers/config';
import { IonicWindow } from './types/interfaces';
import { raf } from './util/util';

let didInitialize = false;

export const appInitialize = (config: Config, doc: Document, zone: NgZone) => {
return (): any => {
const win: IonicWindow | undefined = doc.defaultView as any;
if (win) {
if (didInitialize) {
console.warn('Ionic Angular was already initialized. Make sure IonicModule.forRoot() is just called once.');
}
didInitialize = true;
const Ionic = win.Ionic = win.Ionic || {};

Ionic.config = {

0 comments on commit e98769e

Please sign in to comment.
You can’t perform that action at this time.