我从json文件获取html实体,例如:’
。如何在html组件中取消转义?
我创建了自定义管道,但仅适用于像&
这样的实体:
import { Pipe, PipeTransform } from '@angular/core';
import {unescape} from 'lodash';
@Pipe({
name: 'unescape'
})
export class UnescapePipe implements PipeTransform {
transform(value: any, args?: any): any {
return unescape(value);
}
}
- 我正在使用 Angular 5 进行开发。