前沿web开发框架
Angular
Angular 是一个开发平台。它能帮你更轻松的构建 Web 应用。Angular 集声明式模板、依赖注入、端到端工具和一些最佳实践于一身,为你解决开发方面的各种挑战。Angular 为开发者提升构建 Web、手机或桌面应用的能力。
Angular subscribe loading
2020年11月17日
最近在使用Angular rxjs的时候,获取数据的时候,页面显示增加加载,代码如下:article.component.html<div class="page-loading" *ngIf="isLoading$ | async"> <mat-spinner></mat-spinner></div><table *ngIf="!(isLoading$ | async)" mat-tabl...
Angular 提交 按钮加载,button 加载mat-spinner动画
2020年11月16日
最近在使用Angular,每当修改内容提交的时候,禁止用户再次点击,这个时候需要将按钮变成disabled状态。具体实现效果如下:具体代码如下:css样式:@keyframes spinner { to {transform: rotate(360deg);}}.spinner:before { content: ''; box-sizing: border-box; position: ...
mat-table 如何设置Index
2020年11月11日
最近在使用Angular Material的mat-table的时候,需要设置表格的编号。具体代码如下:表头设置:displayedColumns: string[] = ['index'];之后设置index列:<ng-container matColumnDef="index"> <th mat-header-cell *matHeaderCellDef> No.</th> <td...
mat-table 刷新数据源
2020年11月09日
最近在使用Angular Material的时候,使用mat-table修改表格,数据不同步更新。delete($event, id, root, section, child): void { const dialogRef = this.dialog.open(MenuDialogComponent, { width: '20vw', data: {id, r...
Metronic Angular 7.1.2 asideMenu解析
2020年10月28日
最近在写后台管理系统,前端使用的是Angular,完全使用Angular自己编写一个管理框架十分麻烦,而且自己能力有限,估计架构没做好,最后会成为一个牵一发而动全身垃圾架构。所以还是使用Metronic左右一个现成的成品,我顺便也可以学习以下别人的架构模式,在大型系统中如何设计Angular。这里首先是登录之后,左边的菜单一直不知道需要在哪里修改,经过一番寻找之后,在这个位置修改左边菜单(asid...
Angular proxy
2020年10月23日
最近Angular在调用后端的时候,出现了跨域警告。具体提示如下:Access to XMLHttpRequest at 'http://localhost:5000/api/v1/account/profile' from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight r...
Angular 依赖提供者理解
2020年10月14日
下面是DI的一个示例代码:providers: [ { provide: AuthServiceConfig, useFactory: getAuthServiceConfigs } ],这里组件使用令牌请求AuthServiceConfig对象时,同时使用getAuthServiceConfigs工厂函数注入值。参考资料:1、替代类提供者2、工厂提供者