/ *---HTML----* /<ion-content> <Button(click)= "Manual ()">Manual shutdown</Button> <Button(click)= "Automatic ()">Auto Close</Button> </ion-content>/ *---HTML----* /
/*---js----*/Import {Page, Loading, Navcontroller} from' Ionic-angular '; @Page ({templateurl:' Build/pages/tabs/tabs.html ',}) Export class Tabspage {static get parameters () {return[[Navcontroller]]; } constructor (NAV) { This. Nav =nav; } manual () {Let loading=loading.create ({content:"Please wait ...", Spinner:' Ios-small ', }); This. nav.present (loading); SetTimeout (()={Loading.dismiss (); Console.log (' I did not set the Duration property. I closed it manually. ‘) },1000)} automatic () {Let loading=loading.create ({content:"Please wait ...", Spinner:' Ios-small ', Duration:1000 }); This. nav.present (loading); Loading.ondismiss (()={Console.log (' I was automatically closed. ‘) }); } } //Loading Setting parameters//1. Content: Contents, can be HTML statement//2, Duration: Duration of time, when the time to go to the end of the time to go dismiss () method. that is, the method in the identifier of the Loading.create//3, Showbackdrop: Whether to show the background layer//4, spinner:loading icon of the optional SVG iOS, dots, bubbles, circles, Ios-small, Crescent Hide,hide is not to display the icon//5. CssClass: Custom Style//6, Dismissonpagechange: whether to ignore the indicator when navigating to a new page default: Do not ignore, this method is to say this view jumps to another view when this loading is not effective//Note that manual shutdown and auto-Close method names are not the same. /*---js----*/
4. Loading: Loading