From 1a30ba4211462589698d26688ec24319e48b740c Mon Sep 17 00:00:00 2001 From: fengxiang <110431245@qq.com> Date: Wed, 11 Jul 2018 15:08:40 +0800 Subject: [PATCH] 提交 --- src/app/routes/pro/list/card-list/card-list.component.ts | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/src/app/routes/pro/list/card-list/card-list.component.ts b/src/app/routes/pro/list/card-list/card-list.component.ts new file mode 100644 index 0000000..69ee8ad --- /dev/null +++ b/src/app/routes/pro/list/card-list/card-list.component.ts @@ -0,0 +1,31 @@ +import { Component, OnInit, ViewEncapsulation } from '@angular/core'; +import { NzMessageService } from 'ng-zorro-antd'; +import { _HttpClient } from '@delon/theme'; + +@Component({ + selector: 'pro-list-card-list', + templateUrl: './card-list.component.html', + styles: [ + ` + :host ::ng-deep .ant-card-meta-title { + margin-bottom: 12px; + } + `, + ], + encapsulation: ViewEncapsulation.Emulated, +}) +export class ProCardListComponent implements OnInit { + list: any[] = [null]; + + loading = true; + + constructor(private http: _HttpClient, public msg: NzMessageService) {} + + ngOnInit() { + this.loading = true; + this.http.get('/api/list', { count: 8 }).subscribe((res: any) => { + this.list = this.list.concat(res); + this.loading = false; + }); + } +} -- Gitblit v1.8.0