因果报应-找不到自定义管道'错误

时间:2019-08-06 13:59:35

标签: angular pipe karma-jasmine

App运行正常,没有错误消息。但是在我进行测试后,得到了

管道代码

// .cpp or .h file
#define IDD_MainWindow 1 

IDD_MainWindow DIALOGEX 100, 100, 350, 150
STYLE WS_VISIBLE
BEGIN
CONTROL "", ED_ABOUT, "Static", WS_CHILD | WS_VISIBLE | SS_CENTER, 4, 4, 340, 115
CONTROL "&OK", BTN_OK, "Button", WS_VISIBLE | WS_CHILD, 155, 120, 50, 15
END
// --------
CreateDialog(hInstance, MAKEINTRESOURCE(IDD_MainWindow), NULL, DlgProc);

用法:

import { Pipe, PipeTransform } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';

@Pipe ({
    name: 'html'
})

export class innerHTMLPipe implements PipeTransform{
  constructor (private sanitizer: DomSanitizer){

  }

  transform(style){
    return this.sanitizer.bypassSecurityTrustHtml(style);
  }
}

失败:模板解析错误: 找不到管道'html'(“                 ] [innerHtml] =“ buildVersionHtmlReponse | html”>                 

0 个答案:

没有答案