Instantly share code, notes, and snippets.

@anjum121 /Homepage.ts Secret
Last active Nov 30, 2016

Embed
What would you like to do?
Home page where we can use our loader service
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