mirror of
				https://github.com/Redocly/redoc.git
				synced 2025-11-04 09:47:31 +03:00 
			
		
		
		
	
		
			
				
	
	
		
			23 lines
		
	
	
		
			510 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			510 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
'use strict';
 | 
						|
import { Input, HostBinding, Component, OnChanges } from '@angular/core';
 | 
						|
 | 
						|
@Component({
 | 
						|
  selector: 'loading-bar',
 | 
						|
  template: `
 | 
						|
  <span [style.width]='progress + "%"'> </span>
 | 
						|
  `,
 | 
						|
  styleUrls: ['loading-bar.css']
 | 
						|
})
 | 
						|
export class LoadingBar implements OnChanges {
 | 
						|
  @Input() progress:number = 0;
 | 
						|
  @HostBinding('style.display') display = 'block';
 | 
						|
 | 
						|
  ngOnChanges(ch) {
 | 
						|
    if (ch.progress.currentValue === 100) {
 | 
						|
      setTimeout(() => {
 | 
						|
        this.display = 'none';
 | 
						|
      }, 500);
 | 
						|
    }
 | 
						|
  }
 | 
						|
}
 |