我有两个css分类public void HideMessageDialog ()
{
this.Dispatcher.Invoke(
async () =>{
BaseMetroDialog dialogBeingShow =
await this.GetCurrentDialogAsync<BaseMetroDialog>();
//Hide Current Single Dialog
if(dialogBeingShow != null)
await this.HideMetroDialogAsync(dialogBeingShow);
//Or Hide All Dialogs
while (dialogBeingShow != null)
{
await this.HideMetroDialogAsync(dialogBeingShow);
dialogBeingShow =
await this.GetCurrentDialogAsync<BaseMetroDialog>();
}
}
);
}
和triangle
triangleo
所以如果chatdata.usrId == 123 class应为<div class="triangle" ng-repeat="chatdata in chats">
<p>{{chatdata.msg}}</p>
<p> {{chatdata.time}}</p>
</div>
else triangle
答案 0 :(得分:3)
您只需使用ng-class
<div ng-class="chatdata.usrId === 123 ? 'triangle' : 'triangleo'" ng-repeat="chatdata in chats">
<p>{{chatdata.msg}}</p>
<p> {{chatdata.time}}</p>
</div>