首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何停止角11旋转器的加载

如何停止角11旋转器的加载
EN

Stack Overflow用户
提问于 2022-02-14 11:00:49
回答 1查看 739关注 0票数 0

我在我的应用程序中增加了加载旋转器。我想在PDF显示的时候停止它。我增加了代码来停止加载,但这是不可行的。如何解决这个问题。

pdf.component.html

代码语言:javascript
复制
<section>
    <div style='position: relative; height: 100%;'>
        <pdf-viewer style="width: 20px" [src]="pdfsrc+data[0].pdf_name" [render-text]="true" style="display: block;" [rotation]="0"
            [original-size]="false" [show-all]="true" [fit-to-page]="true" [zoom]="0" [zoom-scale]="'page-width'" [stick-to-page]="false"
            [render-text]="true" [external-link-target]="'blank'" [autoresize]="true" [show-borders]="false"></pdf-viewer>
    </div>
</section>
<ngx-spinner bdColor="rgba(51, 51, 51, 0.8)" size="default" type="ball-spin-clockwise">
    <p style="color: rgb(33, 221, 118)">Be Patince PDF is loaded. </p>
</ngx-spinner>

pdf.component.ts

代码语言:javascript
复制
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { ApiService } from '../api.service';
import { NgxSpinnerService } from "ngx-spinner";

@Component({
  selector: 'app-pdf',
  templateUrl: './pdf.component.html',
  styleUrls: ['./pdf.component.css']
})
export class PdfComponent implements OnInit {

  constructor(private aroute: Router, private formBuilder: FormBuilder, private SpinnerService: NgxSpinnerService, private api: ApiService, private activeRoute: ActivatedRoute, private route: Router) {

  }
  data: any;
  //totalPages:any;
  submitted = false;
  ngOnInit(): void {
    this.SpinnerService.show();
    window.scrollTo(0, 0);
    this.api.tbl_report_pdf_data_one(this.activeRoute.snapshot.params.pdfid).subscribe((res) => {
      this.data = res;
  this.SpinnerService.hide();
    })
page: number = 1;
  isLoaded: boolean = false;
  pdfsrc: any = "assets/uploads/";
EN

回答 1

Stack Overflow用户

发布于 2022-02-14 11:55:14

这应该非常简单,只需在HTML中使用isLoaded:

代码语言:javascript
复制
<ngx-spinner *ngIf="!isLoaded" bdColor="rgba(51, 51, 51, 0.8)" size="default" type="ball-spin-clockwise">
    <p style="color: rgb(33, 221, 118)">Be Patince PDF is loaded. </p>
</ngx-spinner>

代码语言:javascript
复制
this.api.tbl_report_pdf_data_one(this.activeRoute.snapshot.params.pdfid).subscribe((res) => {
  this.data = res;
  this.isLoaded = true;
})
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71110786

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档