【发布时间】:2021-03-10 22:38:02
【问题描述】:
我想在我的 Angular 组件中呈现外部输入模板。但是没有找到“http”。我还在项目中安装了@types/node,但这并没有解决依赖关系。
我正在尝试通过此代码进行设置:
<div style="height: 300px;">
<div [innerHTML]="stepTemplate"></div>
</div>
setView() {
const temp = this.inputModel.templateUrl;
this.stepTemplate = this.http.get(temp).map((html: any) => this.stepTemplate = html);
}
import * as Http from 'http';
export class JourneyLineComponent implements OnInit, AfterViewInit {
.....
http: Http;
}
【问题讨论】:
标签: angular typescript http templates angular10