angular - Angular 5将html导出到图像
问题描述
打扰一下,我如何将 html 导出为角度 5 的图像。
书店什么的?
有没有办法用角度5做到这一点?
解决方案
如果你想动态添加图片的 url 链接,这里是代码。您可以将输入文本事件更改为要存储的 HTML 链接。模块 HTML 的 HTML:
<h1>{{title}}</h1>
<div>
<input type="text" (input)="onInputEvent($event)">
</div>
<div>
<a [href]='url'>
<img
src="smiley.gif"
alt="HTML tutorial"
style="width:42px;height:42px;border:0;">
</a>
</div>
模块打字稿:
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'MY TEST';
url:string ;
onInputEvent(event:Event){
this.url=(<HTMLInputElement>event.target).value;
}
}
推荐阅读
- android - 片段内的 OnTouchListener 停止 Viewpager 滑动事件
- python-3.x - 通过 FLAGS 将参数解析到 Tensorflow 应用程序以启动并行作业
- iis - IIS 日志解析器上的第 95、99 个百分位
- vba - 在VBA中对具有相同值的行进行分组
- java - Tomcat 的 Nginx 代理在大约 17 分钟后终止连接
- r - 在 R 中写入 .csv 时如何更改 DTM 的行名
- javascript - React Portal 功能组件
- mongodb - mongodb聚合,根据查找结果排序
- xml - FILTERXML 获取数据
- lua - 'Value' 的错误参数#3(字符串预期,得到对象) - 我该如何解决这个问题?