@ionic/angular#LoadingController TypeScript Examples

The following examples show how to use @ionic/angular#LoadingController. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ux.service.ts    From Elastos.Essentials.App with MIT License 6 votes vote down vote up
constructor(
    public translate: TranslateService,
    private zone: NgZone,
    private nav: GlobalNavService,
    private native: GlobalNativeService,
    private popoverCtrl: PopoverController,
    private events: Events,
    private didSessions: GlobalDIDSessionsService,
    private loadingCtrl: LoadingController,
    private theme: GlobalThemeService
  ) {
    selfUxService = this;
    UXService.instance = this;

    this.events.subscribe('showDeleteIdentityPrompt', (identity) => {
      this.zone.run(() => {
        void this.showDeletePrompt(identity);
      });
    });
  }
Example #2
Source File: overlay.service.ts    From onchat-web with Apache License 2.0 6 votes vote down vote up
constructor(
    private globalData: GlobalData,
    private toastCtrl: ToastController,
    private alertCtrl: AlertController,
    private modalCtrl: ModalController,
    private loadingCtrl: LoadingController,
    private popoverCtrl: PopoverController,
    private actionSheetCtrl: ActionSheetController,
    private notificationCtrl: NotificationController,
    @Inject(DOCUMENT) private document: Document,
    @Inject(NAVIGATOR) private navigator: Navigator
  ) { }
Example #3
Source File: go-pro-media-item-detail-on-camera.component.ts    From capture-lite with GNU General Public License v3.0 6 votes vote down vote up
constructor(
    private readonly location: Location,
    private readonly route: ActivatedRoute,
    private readonly router: Router,
    public toastController: ToastController,
    public alertController: AlertController,
    public loadingController: LoadingController,
    public goProMediaService: GoProMediaService,
    public goProWiFiService: GoProWifiService
  ) {
    this.route.queryParams.subscribe(_ => {
      const state = this.router.getCurrentNavigation()?.extras.state;
      if (state) {
        this.mediaFile = state.goProMediaFile;
      }
    });
  }
Example #4
Source File: schedule.ts    From actions-test with Apache License 2.0 6 votes vote down vote up
constructor(
    public alertCtrl: AlertController,
    public confData: ConferenceData,
    public loadingCtrl: LoadingController,
    public modalCtrl: ModalController,
    public router: Router,
    public toastCtrl: ToastController,
    public user: UserData,
    public config: Config
  ) { }
Example #5
Source File: native.service.ts    From Elastos.Essentials.App with MIT License 6 votes vote down vote up
constructor(
        private loadingCtrl: LoadingController,
        public popoverCtrl: PopoverController,
        private zone: NgZone,
        private globalNative: GlobalNativeService,
        private globalNav: GlobalNavService,
    ) {
        Native.instance = this;
    }
Example #6
Source File: developer.service.ts    From Elastos.Essentials.App with MIT License 6 votes vote down vote up
constructor(
    private toastController: ToastController,
    private loadingCtrl: LoadingController,
    private zone: NgZone,
    private prefs: GlobalPreferencesService,
    private globalNetworksService: GlobalNetworksService,
    private globalSecurityService: GlobalSecurityService,
    private globalNavService: GlobalNavService
  ) {
    super();
  }
Example #7
Source File: global.native.service.ts    From Elastos.Essentials.App with MIT License 6 votes vote down vote up
constructor(
        private toastCtrl: ToastController,
        private alertCtrl: AlertController,
        private loadingCtrl: LoadingController,
        private translate: TranslateService,
        private theme: GlobalThemeService,
        private modalCtrl: ModalController,
        private clipboard: Clipboard,
    ) { }
Example #8
Source File: service-map.page.ts    From Uber-ServeMe-System with MIT License 6 votes vote down vote up
constructor(
    public toastCtrl: ToastController,
    private platform: Platform,
    private loadingCtrl: LoadingController,
    // private ngZone: NgZone,
    public route: Router,
    public activatedRoute: ActivatedRoute,
    public nav: NavController,
    private elementRef: ElementRef,
    private renderer: Renderer2,
    public modalCtrl: ModalController,
    public firestore: AngularFirestore,
    public navCtrl: NavController,
    // private dataService: DataService,
  ) { 
    // console.log('declared var:', google)

    // this.activateRoute.queryParams.subscribe((data: any) => {
    //   console.log("data.service:", data.service)
    //   this.service = data.service
    //   console.log("service1:", this.service)
    // })
  }
Example #9
Source File: vendor-location.page.ts    From Uber-ServeMe-System with MIT License 6 votes vote down vote up
constructor(
    public toastCtrl: ToastController,
    private platform: Platform,
    private loadingCtrl: LoadingController,
    private ngZone: NgZone,
    public route: Router,
    public activateRoute: ActivatedRoute,
    public nav: NavController,
    public user: UserService,
    public homeService: HomeServiceService,
    public afstore: AngularFirestore,
    public toast: ToastController,
    public router: Router,
  ) {
  }
Example #10
Source File: vendor.page.ts    From Uber-ServeMe-System with MIT License 6 votes vote down vote up
constructor(
    private afAuth: AngularFireAuth,
    private userService: UserService,
    private loadingCtrl: LoadingController,
    private homeServiceService: HomeServiceService,
    private toastCtrl: ToastController,
    public firestore: AngularFirestore,
    private popCtrl: PopoverController,
  ) {
 
   }
Example #11
Source File: service-detail.page.ts    From Uber-ServeMe-System with MIT License 6 votes vote down vote up
constructor(
    private homeServiceService: HomeServiceService,
    private activatedRoute: ActivatedRoute, 
    private navCtrl: NavController,
    private loadingCtrl: LoadingController,
    private userService: UserService,
    private toastCtrl: ToastController
  ) {
    this.homeSeviceId = this.activatedRoute.snapshot.params['id'];
    if (this.homeSeviceId) this.loadProduct();
  }
Example #12
Source File: service-confirm.page.ts    From Uber-ServeMe-System with MIT License 6 votes vote down vote up
constructor(
    public router: Router,
    public toastCtrl: ToastController,
    private platform: Platform,
    private loadingCtrl: LoadingController,
    public route: Router,
    public activateRoute: ActivatedRoute,
    public nav: NavController,
    public firestore: AngularFirestore,
  ) { 
    this.activateRoute.queryParams.subscribe(params => {
      console.log('params: ', params);
      if (params && params.vendor) {
        this.data = JSON.parse(params.vendor);
      }
      if (params && params.back) {
        this.back = params.back;
      }
      console.log('params: ', this.back);
    })

  }
Example #13
Source File: place-request.page.ts    From Uber-ServeMe-System with MIT License 6 votes vote down vote up
constructor(
    private homeServiceService: HomeServiceService,
    private activatedRoute: ActivatedRoute, 
    private navCtrl: NavController,
    private loadingCtrl: LoadingController,
    private userService: UserService,
    private toastCtrl: ToastController,
    private router: Router,
    public activateRoute: ActivatedRoute,
    public afstore: AngularFirestore,
    public afAuth: AngularFireAuth,
  ) {
    this.homeSeviceId = this.activatedRoute.snapshot.params['id'];
    console.log('placerequest id', this.homeSeviceId)
    if (this.homeSeviceId) this.loadProduct();

    this.activateRoute.queryParams.subscribe(params => {
      console.log('params: ', params);
      if (params && params.vendor) {
        this.data = JSON.parse(params.vendor);
      }
      if (params && params.back) {
        this.back = params.back;
      }
      console.log('params: ', this.back);
    })
  }
Example #14
Source File: login.page.ts    From Uber-ServeMe-System with MIT License 6 votes vote down vote up
constructor(
    public afAuth: AngularFireAuth,
    public loadingController: LoadingController,
    private googlePlus: GooglePlus,
    private router: Router,
    private nativeStorage: NativeStorage,
    private platform: Platform,
    public alertController: AlertController,
    public toastController: ToastController,
    public user: UserService,
    public afstore: AngularFirestore,
    ) { }
Example #15
Source File: history.page.ts    From Uber-ServeMe-System with MIT License 6 votes vote down vote up
constructor(
    private userService: UserService,
    private loadingCtrl: LoadingController,
    private toastCtrl: ToastController,
    private router: Router,
  ) {
    this.orderSubscription = this.userService.getOrders().subscribe(data => {
      this.orders = data
    })
  }
Example #16
Source File: add-service.page.ts    From Uber-ServeMe-System with MIT License 6 votes vote down vote up
// private coordinates: any
  // private latitude: any
  // private longitude: any

  constructor(
    private homeServiceService: HomeServiceService,
    private activatedRoute: ActivatedRoute,
    private navCtrl: NavController,
    private loadingCtrl: LoadingController,
    private userService: UserService,
    private toastCtrl: ToastController,
    // private geolocation: Geolocation,
  ) {
    this.homeSeviceId = this.activatedRoute.snapshot.params['id'];
    if (this.homeSeviceId) this.loadProduct();
    
    // this.geolocation.getCurrentPosition(resp => {
    //   this.latitude = resp.coords.latitude
    //   this.longitude = resp.coords.longitude
    //   const infoWindow = new google.maps.InfoWindow;
    // }), err=> { console.log(err)}
  }
Example #17
Source File: loading.service.ts    From mylog14 with GNU General Public License v3.0 5 votes vote down vote up
constructor(
    private readonly loadingCtrl: LoadingController,
    private readonly translate: TranslateService,
  ) { }
Example #18
Source File: loading.service.ts    From contact-tracer with MIT License 5 votes vote down vote up
constructor(private loadingController: LoadingController) { }
Example #19
Source File: loader.service.ts    From fyle-mobile-app with MIT License 5 votes vote down vote up
constructor(private loadingController: LoadingController) {}
Example #20
Source File: go-pro.page.ts    From capture-lite with GNU General Public License v3.0 5 votes vote down vote up
constructor(
    public toastController: ToastController,
    private readonly loadingController: LoadingController,
    private readonly router: Router,
    private readonly goProBluetoothService: GoProBluetoothService
  ) {}
Example #21
Source File: blocking-action.service.spec.ts    From capture-lite with GNU General Public License v3.0 5 votes vote down vote up
describe('BlockingActionService', () => {
  let service: BlockingActionService;
  let htmlIonLoadingElementSpy: jasmine.SpyObj<HTMLIonLoadingElement>;
  const value1 = 8;
  const value2 = 9;
  const action$ = of(value1, value2);
  const errorMessage = 'error!';
  const errorAction$ = action$.pipe(
    map(() => {
      throw new Error(errorMessage);
    })
  );

  beforeEach(() => {
    TestBed.configureTestingModule({
      imports: [SharedTestingModule],
    });
    service = TestBed.inject(BlockingActionService);
    const loadingController = TestBed.inject(LoadingController);

    htmlIonLoadingElementSpy = jasmine.createSpyObj('HTMLIonLoadingElement', {
      present: new Promise<void>(resolve => resolve()),
      dismiss: new Promise<boolean>(resolve => resolve(true)),
    });

    spyOn(loadingController, 'create').and.resolveTo(htmlIonLoadingElementSpy);
  });

  it('should be created', () => expect(service).toBeTruthy());

  it('should return the same expected value to the action', done => {
    service
      .run$(action$)
      .pipe(toArray())
      .subscribe(result => {
        expect(result).toEqual([value1, value2]);
        done();
      });
  });

  it('should throw error if action has error', done => {
    service.run$(errorAction$).subscribe({
      error: (err: unknown) => {
        if (err instanceof Error) {
          expect(err.message).toEqual(errorMessage);
          done();
        }
      },
    });
  });

  it('should dismiss the blocking dialog when action is completed', done => {
    const subscription = service.run$(action$).subscribe({
      complete: () => {
        subscription.unsubscribe();
        expect(htmlIonLoadingElementSpy.dismiss).toHaveBeenCalled();
        done();
      },
    });
  });

  it('should dismiss the blocking dialog when action throws errors', done => {
    const subscription = service.run$(errorAction$).subscribe({
      error: () => {
        subscription.unsubscribe();
        expect(htmlIonLoadingElementSpy.dismiss).toHaveBeenCalled();
        done();
      },
    });
  });

  // TODO: See #263.
  // it('should block events from physical back button on Android', () => {});
});
Example #22
Source File: blocking-action.service.ts    From capture-lite with GNU General Public License v3.0 5 votes vote down vote up
constructor(
    private readonly loadingController: LoadingController,
    private readonly translocoService: TranslocoService
  ) {}