html - json管道不显示正则表达式数据
问题描述
我有一个 json 对象,我想在我的 html 页面上显示:
this.pattern = [
{pattern: /AA/g, backgroundColor: '#D72638'}
];
为此,我像这样使用 json 管道:
<pre>{{pattern | json}}</pre>
该对象正确显示在 html 页面上,但正则表达式没有。我能做些什么才能展示它?
解决方案
推荐阅读
- html - 通过 Xpath 移动光标
- javascript - 如何在 javascript 代码中更改 django 模板变量值?
- javascript - 如何在ajax请求期间禁用按钮
- php - AJAX 共享 JS 和 PHP 处理文件
- python - 如何在 matplotlib 的完全自定义位置放置次要刻度?
- java - Android xml 文件突然显示 java 代码。
- reactjs - 从状态副本中删除数据后反应 setState 不起作用
- node.js - 返回 axios 数据未定义
- c# - 为什么这种插入排序会返回索引超出范围异常?
- angular - Angular 6 ngClass 没有打开布尔值