2017-12-15 23:22:34 -05:00
|
|
|
import { Component, EventEmitter, Input, Output } from "@angular/core";
|
|
|
|
import { DomSanitizer, SafeResourceUrl } from "@angular/platform-browser";
|
2017-12-24 04:02:57 -05:00
|
|
|
import { FE_Integration } from "../shared/models/integration";
|
2017-12-15 23:22:34 -05:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: "my-integration-bag",
|
|
|
|
templateUrl: "./integration-bag.component.html",
|
|
|
|
styleUrls: ["./integration-bag.component.scss"],
|
|
|
|
})
|
|
|
|
export class IntegrationBagComponent {
|
|
|
|
|
2017-12-24 04:02:57 -05:00
|
|
|
@Input() integrations: FE_Integration[];
|
|
|
|
@Output() integrationClicked: EventEmitter<FE_Integration> = new EventEmitter<FE_Integration>();
|
2017-12-15 23:22:34 -05:00
|
|
|
|
|
|
|
constructor(private sanitizer: DomSanitizer) {
|
|
|
|
}
|
|
|
|
|
|
|
|
public getSafeUrl(url: string): SafeResourceUrl {
|
|
|
|
return this.sanitizer.bypassSecurityTrustResourceUrl(url);
|
|
|
|
}
|
|
|
|
|
2017-12-24 04:02:57 -05:00
|
|
|
public onClick(integration: FE_Integration) {
|
2017-12-15 23:22:34 -05:00
|
|
|
this.integrationClicked.emit(integration);
|
|
|
|
}
|
|
|
|
}
|