2017-12-11 11 views
-3

私は複数行にテキストを表示するためにテキストラップを使用しました。私は、テキストが1行よりも大きいときに3つの点を表示したい。クリックする前に説明後に3つのドットを表示する方法は?

<ion-item text-wrap *ngIf="list.STATUS=='ACTIVE'" style="padding-left:30px;padding-right:30px;"> 
     <div (click)="list.isExpanded = !list.isExpanded" [style.height]="list.isExpanded?'auto':'20px'"> 
     <p style="color: #9DA4AB;font-size: 15px;">{{list.TASKDESC}}</p> 
     <hr> 
     <p style="color: #9DA4AB;font-size: 10px;">{{list.DEADLINE_DT}}</p> 
     </div> 

    </ion-item> 

enter image description here

クリック enter image description here

+1

使用 'Pipe'、https://angular.io/guide/pipes – Jobin

+0

[テキストオーバーフローの利用CSS:省略記号(https://developer.mozilla.org/en-US/docs/ Web/CSS/text-overflow) – Jai

+0

私はtext-overflow:ellipsisを使用しましたが、それは動作しません。 –

答えて

0

.htmlを

<ion-item text-wrap *ngIf="list.STATUS=='ACTIVE'" style="padding-left:30px;padding-right:30px;"> 
     <div (click)="list.isExpanded = !list.isExpanded" [style.height]="list.isExpanded?'auto':'20px'"> 

     <p [class.isCollapsed]="!list.isExpanded">{{list.TASKDESC}}</p> 

     <hr> 
     <p>{{list.DEADLINE_DT}}</p> 
     </div> 
</ion-item> 

.scss

.isCollapsed{ 
    white-space: nowrap; 
    text-overflow: ellipsis; 
    overflow: hidden; 
} 
+0

私はこのコードを使用しましたが、線で3つの点を表示していません。点を表示する方法を教えてください。 –

+0

説明が折りたたまれた状態で、 'isCollapsed'クラスが適用されているかどうかをinspect要素でブラウザで確認できますか? – 99tharun

関連する問題