matrix-dimension/web/app/widget_wrappers/gcal/gcal.component.ts
2017-12-11 17:29:57 -07:00

19 lines
696 B
TypeScript

import { Component } from "@angular/core";
import { ActivatedRoute } from "@angular/router";
import { DomSanitizer, SafeUrl } from "@angular/platform-browser";
@Component({
selector: "my-gcal-widget-wrapper",
templateUrl: "gcal.component.html",
styleUrls: ["gcal.component.scss"],
})
export class GCalWidgetWrapperComponent {
public embedUrl: SafeUrl = null;
constructor(activatedRoute: ActivatedRoute, sanitizer: DomSanitizer) {
let params: any = activatedRoute.snapshot.queryParams;
const embedUrl = "https://calendar.google.com/calendar/embed?src=" + params.calendarId;
this.embedUrl = sanitizer.bypassSecurityTrustResourceUrl(embedUrl);
}
}