I found this solution. Is it valid?
import {Component} from \'@angular/core\'; import {Platform} from \'ionic-angular\'; @Component({...}) export MyApp { co
Keep in mind if you are wanting to test this component you will want to inject the window. Use the @Inject() function to inject the window object by naming it using a string token like detailed in this duplicate