<i class="material-icons" mat-raised-button [matTooltip]="xyz|list" matTooltipClass="tooltip-lis" matTooltipPosition="below" arialabel="">info</i> </div>
// created directive
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({ name: 'list' })
export class TooltipListPipe implements PipeTransform {
transform(lines: string[]): string {
let list: string = 'Chose a strong password by having ';
console.log('lines>>>>>>>>>>>>>', lines);
lines.forEach((line) => {
list += '\n';
list += '•' + line + '\n' ;
// return list;
});
console.log('list>>>>>>>>>>>>>', list);
return list;
}
}
//控制台在工具提示的文本框中输入了我想要的内容 列表>>>>>>>>>>>>>>>通过选择一个强密码 •洗车 •剪头发 •买牛奶