You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
pocketcommunityweb/src/app/forum/forum.component.ts

52 lines
993 B

import {Component, OnInit} from '@angular/core';
import {Router} from '@angular/router';
import {ForumService} from './forum.service';
import {Result} from '../interface/Result';
/**
* 论坛组件
*/
@Component({
selector: 'app-forum',
templateUrl: './forum.component.html',
styleUrls: ['./forum.component.scss']
})
export class ForumComponent implements OnInit {
/**
* 公告信息
*/
notices: [
{
managerName: string;
content: string;
title: string,
createTime: number
}
];
constructor(
private router: Router,
private forumService: ForumService
) {
}
/**
* 获取公告信息
*/
getAllNotices() {
this.forumService.getAllNotices().subscribe(res => {
if (res.result === Result.OK) {
console.debug('获取公告信息成功');
this.notices = res.body;
} else {
alert('获取公告信息失败');
}
});
}
ngOnInit(): void {
this.getAllNotices();
}
}