我为响应消息创建了烤面包机(小吃店)。我想在烤面包机(小吃店)上添加一个 html 内容,以便可以以正确的格式显示多条消息。
我试过了
var test ='<html> <body>' + '<h1>The Header</h1>' + '<p>The paragraph of text</p>' + '</body> </html>';
this._toastr.error(test);
_toastr : is my service.
.error : is my function in which I have to pass htmlContent
Run Code Online (Sandbox Code Playgroud)
我的代码
var test = '<html> <body>' + '<h1>The Header</h1>' + '<p>The paragraph of text</p>' + '</body> </html>';
this._toastr.error(test);
Run Code Online (Sandbox Code Playgroud)
输出应为:- 以下 xxx/xxx 的价格已于 2018 年 11 月 27 日输入。
我想要这个东西在烤面包机(小吃店)
我是Angular的新手,正在寻找席卡上的分页。我看到的示例仅对表进行分页。
我有数百个代码,希望将其限制为每页8-10张卡片。如何做到这一点?这是我的html和ts代码。
.html文件
<div class="flip-right" [ngClass]="mobileQuery.matches ? 'card-wrapper-mobile' : 'card-wrapper'" *ngFor="let items of datasource">
<div class="card">
<div class="front">
<mat-card [ngClass]="mobileQuery.matches ? 'mobile-card' : 'desktop-card'">
<a routerLink="/viewPage">
<mat-card-header class="header">
<mat-card-title>{{items.name}} <mat-icon class="verified title" [inline]="true" >lock</mat-icon></mat-card-title>
</mat-card-header>
<mat-card-subtitle class="first-subtitle">Last updated on:{{items.Last_updated_on}}</mat-card-subtitle>
<mat-card-subtitle>Last updated by:{{items.Last_updated_by}}</mat-card-subtitle>
<mat-card-subtitle>{{items.created_by}}</mat-card-subtitle>
</a>
</mat-card>
</div>
<div class="back">
<mat-card [ngClass]="mobileQuery.matches ? 'mobile-card' : 'desktop-card'">
<a routerLink="/viewPage">
<mat-card-header>
<mat-card-title>{{items.name}}<mat-icon class="verified" [inline]="true" >lock</mat-icon></mat-card-title>
</mat-card-header>
</a>
</mat-card>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
.ts文件
import { Component, OnInit,ViewChild } from '@angular/core';
import { Subscription } from …Run Code Online (Sandbox Code Playgroud) mat-sort无法处理mat-table来自另一个数据库的的一个列,其余的列则工作正常。唯一的区别是,我正在从另一服务获取该列的数据。
我试图解决它,ngAfterViewInit但无济于事。
ngAfterViewInit(){
this.dataSource.sort = this.sort;
};
Run Code Online (Sandbox Code Playgroud)
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Resource </th>
<td mat-cell *matCellDef="let element"> {{element.creator.name}} </td>
<td mat-footer-cell *matFooterCellDef> </td>
</ng-container>
Run Code Online (Sandbox Code Playgroud)
displayedColumns: string[] = ['projectName', 'date', 'hours', 'description', 'name', 'location', 'Edit'];
@ViewChild(MatSort) sort: MatSort;
ngOnInit(){
this.dataSource.sort = this.sort;
}
Run Code Online (Sandbox Code Playgroud)