-
-
Save anjum121/7cdb8308eb82ce4aa6bd2ce5e72f30c5 to your computer and use it in GitHub Desktop.
Home page where we can use our loader service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from '@angular/core'; | |
import { NavController, NavParams } from 'ionic-angular'; | |
import { LoaderService} from '../services/service.loading'; | |
@Component({ | |
selector: 'page-home', | |
templateUrl: 'home.html' | |
}) | |
export class HomePage { | |
pageTitle:String; | |
constructor(public navCtrl: NavController, public navParams: NavParams, public loader:LoaderService) {} | |
ionViewDidLoad() { | |
let loaderOptions = { | |
message:'This is custom message', | |
time:3000 | |
}; | |
// we can just call loader with default settings as below | |
// this.loader.show({}); | |
// or with some custom settings | |
// this.loader.show(loaderOptions); | |
this.loader.show({}); | |
setTimeout(()=>{ | |
this.loader.hide() | |
}, 2000) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment