alfresco-ng2-components/docs/core/comment-list.component.md
Andy Stark e03f3a1a6b [ADF-3323] Fixed broken links in doc files (#3662)
* [ADF-3323] Fixed URL path to Typescript source files

* [ADF-3323] Fixed and checked broken links caused by previous bug
2018-08-14 15:42:45 +01:00

1.6 KiB

Added, Status
Added Status
v2.0.0 Active

Comment list component

Shows a list of comments.

ADF Comment List

Basic Usage

Populate the comments in the component class:

import { CommentProcessModel } from '@alfresco/adf-core';

export class SomeComponent implements OnInit {

  comments: CommentProcessModel[] = [
    {
      id: 1,
      message: 'Comment number 1',
      created: new Date(),
      createdBy: {
        id: 1,
        email: 'john.doe@alfresco.com',
        firstName: 'John',
        lastName: 'Doe'
      },
    },
    {
      id: 2,
      message: 'Comment number 2',
      created: new Date(),
      createdBy: {
        id: 2,
        email: 'jane.doe@alfresco.com',
        firstName: 'Jane',
        lastName: 'Doe'
      },
    }
  ];

  onClickCommentRow(comment: CommentProcessModel) {
    console.log('Clicked row: ', comment);
  }

In the component template use the comment list component:

<adf-comment-list
    [comments]="comments"
    (clickRow)="onClickCommentRow($event)">
</adf-comment-list>

Class members

Properties

Name Type Default value Description
comments CommentModel[] The comments data used to populate the list.

Events

Name Type Description
clickRow EventEmitter<CommentModel> Emitted when the user clicks on one of the comment rows.