首页 > 解决方案 > json管道不显示正则表达式数据

问题描述

我有一个 json 对象,我想在我的 html 页面上显示:

  this.pattern = [
      {pattern: /AA/g, backgroundColor: '#D72638'}
  ];

为此,我像这样使用 json 管道:

<pre>{{pattern | json}}</pre>

该对象正确显示在 html 页面上,但正则表达式没有。我能做些什么才能展示它?

标签: htmljsonangularregex

解决方案


推荐阅读