【发布时间】:2018-03-22 18:26:46
【问题描述】:
想要将此 iframe 嵌入到我的模板中,但出现错误 这里是iframe代码,要放在组件的模板里面
<iframe [src]="http://www.youtube.com/embed/{{show.trailer}}"
width="560" height="315" frameborder="0" allowfullscreen></iframe>
这里是类型脚本文件
import { Component, OnInit } from '@angular/core';
import { Show } from '../show';
import { ActivatedRoute } from '@angular/router';
import { ShowService } from '../show.service';
@Component({
selector: 'app-show-details',
templateUrl: './show-details.component.html',
styleUrls: ['./show-details.component.css']
})
export class ShowDetailsComponent implements OnInit {
show: Show;
constructor(
private route: ActivatedRoute,
private showService: ShowService
) { }
ngOnInit(): void {
this.getShows();
}
【问题讨论】: