Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 角4;当有很多字符时,在表格单元格中显示更多_Angular - Fatal编程技术网

Angular 角4;当有很多字符时,在表格单元格中显示更多

Angular 角4;当有很多字符时,在表格单元格中显示更多,angular,Angular,我有这样一个代码结构: {{'CUSTOMER.MESSAGES_LIST_TABLE.MESSAGE'| translate}} {{row.messageText}} 这是一张桌子的碎片 假设mat单元格中有一些内容。如果内容太长,例如,当内容达到100位时,我想在mat单元格中添加“显示更多范围”,以便单击它并展开此表格单元格以显示剩余内容 你对如何做有什么建议吗?我的第一个想法是抓取jQuery-$mat单元格中的元素,放置一些条件content.length>100并添加show mo

我有这样一个代码结构:

{{'CUSTOMER.MESSAGES_LIST_TABLE.MESSAGE'| translate}} {{row.messageText}} 这是一张桌子的碎片

假设mat单元格中有一些内容。如果内容太长,例如,当内容达到100位时,我想在mat单元格中添加“显示更多范围”,以便单击它并展开此表格单元格以显示剩余内容

你对如何做有什么建议吗?我的第一个想法是抓取jQuery-$mat单元格中的元素,放置一些条件content.length>100并添加show more。然后添加。单击以显示更多内容并展开mat单元格高度

我想强调的是,我是新来的,所以我会很感激你给我简单的答案

关键是

您的行必须有两个属性messageText和,例如showAll:boolean 使用*ngIf=row.showAll可以隐藏显示按钮showMore或按钮showLess和row.messageText或row.messageText.substring0100 该按钮仅切换变量row.showAll 你也可以做一根管子