当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript SlimLoadingBarService.start方法代码示例

本文整理汇总了TypeScript中ng2-slim-loading-bar.SlimLoadingBarService.start方法的典型用法代码示例。如果您正苦于以下问题:TypeScript SlimLoadingBarService.start方法的具体用法?TypeScript SlimLoadingBarService.start怎么用?TypeScript SlimLoadingBarService.start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ng2-slim-loading-bar.SlimLoadingBarService的用法示例。


在下文中一共展示了SlimLoadingBarService.start方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: ngOnInit

  public ngOnInit() {
    // Mouseflow integration
    if ((window as any)._mfq) {
      (window as any)._mfq.push(['newPageView', '/appointment/patient']);
    }

    // Set up page
    this._state.isSubPage.next(true);
    this._state.title.next();
    this._state.actions.next();
    this._state.primaryAction.next();

    // Retrieve patient to be displayed from route and retrieve data from service
    const param: string = this.route.snapshot.params['id'];

    this.slimLoadingBarService.start();
    this.patientService.patientFindById(param)
    .subscribe(
      (patient) => {
        this.patient = patient;
        this._state.title.next(patient.givenName + ' ' + patient.surname);
        this.findAppointmentsForPatient(this.patient.id);
      },
      (err) => console.log(err)
    );

    // Set up localized humanizer for durations
    this.localeHumanizer = humanizeDuration.humanizer({
      language: localStorage.getItem('locale').startsWith('de') ? 'de' : 'en'
    });
  }
开发者ID:carolduan,项目名称:medical-appointment-scheduling,代码行数:31,代码来源:patient.component.ts

示例2: http

  http(options: any) {

    let method: string = options.method || 'GET';
    let url = options.url ? options.url : '/api' + options.path;
    let args = [ url ];

    let headers = new Headers();
    if (options.data) {
      headers.set('Content-Type', 'application/json');
      args.push(JSON.stringify(options.data));
    }

    if (this.authToken) {
      headers.set('Authorization', 'Bearer ' + this.authToken);
    }

    let query = new URLSearchParams();
    if (options.query) {
      _.each(options.query, function(value, key) {
        query.set(key, value);
      });
    }

    args.push(new RequestOptions({
      headers: headers,
      search: query
    }));

    this.slimLoader.height = '4px';
    this.slimLoader.start();
    return this._http[method.toLowerCase()].apply(this._http, args).finally(() => {
      this.slimLoader.complete();
    });
  }
开发者ID:AlphaHydrae,项目名称:doa,代码行数:34,代码来源:api.service.ts

示例3: ngOnInit

  public ngOnInit() {
    // Mouseflow integration
    if ((window as any)._mfq) {
      (window as any)._mfq.push(['newPageView', '/appointment/accept']);
    }

    // Set up page
    this._state.isSubPage.next(true); // TODO block this #114
    this._state.title.next(
      localStorage.getItem('locale').startsWith('de') ? 'Terminbestätigung' : 'Accept Appointment');
    this._state.actions.next();
    this._state.primaryAction.next();

    // Retrieve data
    this.slimLoadingBarService.start();
    this.appointmentService.appointmentAcceptOffer(this.route.snapshot.params['secret'])
    .subscribe(
      (appointment) => this.acceptedAppointment = appointment,
      (err) => {
        console.log(err);
        if (err._body.error.status === 404 && err._body.error.code === 'NOT_FOUND_OR_EXPIRED') {
          this.failed = true;
        } else {
          console.log(err);
        }
      },
      () => {
        this.slimLoadingBarService.complete();
        console.log('Accepted offer successfully.');
      }
    );
  }
开发者ID:carolduan,项目名称:medical-appointment-scheduling,代码行数:32,代码来源:accept-offer.component.ts

示例4: runSlimLoader

 private runSlimLoader(): void {
     this.slimLoader.start();
     setTimeout(() => this.slimLoader.progress = 14, 200);
     setTimeout(() => this.slimLoader.progress = 17, 400);
     setTimeout(() => this.slimLoader.progress = 20, 500);
     setTimeout(() => this.slimLoader.complete(), 800);
 }
开发者ID:adriancarriger,项目名称:udacity-meetup,代码行数:7,代码来源:app.component.ts

示例5: searchMovie

 searchMovie(title: string) {
     this.slimLoader.start();
     this.movieService.searchMovie(title)
         .subscribe(res => this.movieSearchResults = res.results,
             (error: any) => console.log(error),
             () => this.slimLoader.complete()
         );
 }
开发者ID:,项目名称:,代码行数:8,代码来源:

示例6: if

 this.sub = this.router.events.subscribe(event => {
     if (event instanceof NavigationStart) {
         this.slimLoader.start();
     } else if ( event instanceof NavigationEnd ||
                 event instanceof NavigationCancel ||
                 event instanceof NavigationError) {
         this.slimLoader.complete();
     }
 }, (error: any) => {
开发者ID:akserg,项目名称:ng2-webpack-demo,代码行数:9,代码来源:app.component.ts

示例7: requestHelper

    private requestHelper(additionalOptions?:RequestOptions){
        this.loading.start(() => {

        });
        let options:RequestOptions = ApiAuth.createHttpOptions();
        if (additionalOptions) {
            options = options.merge(additionalOptions);
        }
        let req = this.http.request(new Request(options));
        req.subscribe(res => this.HandleReponse(res), error => this.HandleError(error));
        return req;
    }
开发者ID:luciancaetano,项目名称:curly-app-base,代码行数:12,代码来源:auth.api.ts

示例8: request

 request(method: RequestMethod, url: string, data?: any) {
     this.loadingBar.color = 'blue';
     this.loadingBar.start();
     let options = this.createOptions(method, data);
     return this.http.request(url, options)
         .map((response: Response) => {
             this.loadingBar.color = 'green';
             this.loadingBar.complete();
             try {
                 return response.json() || {};
             } catch(e) {
                 return {};
             }
         })
         .catch((err: any) => this.handleError(err));
 }
开发者ID:finleysg,项目名称:bhmc,代码行数:16,代码来源:bhmc-data.service.ts

示例9: startProgress

 startProgress() {
     // We can listen when loading will be completed
     this.slimLoader.start(() => {
         console.log('Loading complete');
     });
 }
开发者ID:akserg,项目名称:ng2-webpack-demo,代码行数:6,代码来源:slim.component.ts

示例10: runSlimLoader

 runSlimLoader() {
     this.slimLoadingBarService.start();
     setTimeout(() => {
         this.slimLoadingBarService.complete();
     }, 1000);
 }
开发者ID:mocking3,项目名称:payAdmin,代码行数:6,代码来源:app.component.ts


注:本文中的ng2-slim-loading-bar.SlimLoadingBarService.start方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。