Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export class User {
- uid: number;
- name: string;
- constructor(uid: number, name: string) {
- this.uid = uid;
- this.name = name;
- }
- }
- export class Comment {
- user: User;
- initial: string;
- content: string;
- date: String;
- constructor(user: User, content: string) {
- this.user = user;
- this.initial = user.name.slice(0, 1);
- this.content = content;
- this.date = new Date().toISOString();
- }
- // 取得した日付を反映
- setData(date: string): Comment {
- this.date = date;
- return this;
- }
- }
Add Comment
Please, Sign In to add comment