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-20 23:28:43 -05:00
|
|
|
import { 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-23 15:15:54 -05:00
|
|
|
@Input() integrations: Integration[];
|
2017-12-15 23:22:34 -05:00
|
|
|
@Output() integrationClicked: EventEmitter<Integration> = new EventEmitter<Integration>();
|
|
|
|
|
|
|
|
constructor(private sanitizer: DomSanitizer) {
|
|
|
|
}
|
|
|
|
|
|
|
|
public getSafeUrl(url: string): SafeResourceUrl {
|
|
|
|
return this.sanitizer.bypassSecurityTrustResourceUrl(url);
|
|
|
|
}
|
|
|
|
|
|
|
|
public onClick(integration: Integration) {
|
|
|
|
this.integrationClicked.emit(integration);
|
|
|
|
}
|
|
|
|
}
|