Project

General

Profile

« Previous | Next » 

Revision 58598

[Library | Trunk]: Add openaire metrics.

View differences:

iframe.component.ts
4 4
@Component({
5 5
  selector: 'i-frame',
6 6
  template: `
7
    <div  class="iframeContainer uk-height-large" >
8
      <iframe [src]="safeUrl"></iframe>  
7
    <div  *ngIf="!style" class="iframeContainer uk-height-large">
8
      <iframe  [src]="safeUrl"></iframe>
9 9
    </div>
10
    
10
    <div *ngIf="style"  class="iframeContainer" [ngStyle]="style">
11
      <iframe [src]="safeUrl"></iframe>
12
    </div>
11 13
  `
12 14
})
13 15
export class IFrameComponent {
14 16
  public safeUrl: SafeResourceUrl;
15 17
  @Input() url ;
18
  @Input() width: number;
19
  @Input() height: number;
20
  public style: any;
21
  
16 22
  constructor(private sanitizer: DomSanitizer) {
17 23
  }
18 24
  ngOnInit() {
19 25
    this.safeUrl = this.sanitizer.bypassSecurityTrustResourceUrl(this.url);
20
    //console.info("URL:" + this.safeUrl);
26
    if(this.width && this.height) {
27
      this.style = {
28
        "width.px": this.width,
29
        "height.px": this.height
30
      }
31
    }
21 32
  }
22 33
}

Also available in: Unified diff