diff --git a/docs/comment-list.component.md b/docs/comment-list.component.md new file mode 100644 index 0000000000..b340c39ec7 --- /dev/null +++ b/docs/comment-list.component.md @@ -0,0 +1,69 @@ +# Comment list component +Shows a list of comments. + +![ADF Comment List](docassets/images/adf-comment-list.png) + +## Basic Usage +Populate the comments in the component class: + +```ts +import { CommentProcessModel } from 'ng2-alfresco-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: + +```html + + +``` + +### Properties + +| Name | Type | Default | Description | +| --- | --- | --- | --- | +| comments | CommentProcessModel[] | | The comments data used to populate the list | + +### Events + +| Name | Description | +| --- | --- | +| clickRow | Emitted when the user clicks on one of the comment rows | + + + + + \ No newline at end of file diff --git a/docs/docassets/images/adf-comment-list.png b/docs/docassets/images/adf-comment-list.png new file mode 100644 index 0000000000..08ccb1f81f Binary files /dev/null and b/docs/docassets/images/adf-comment-list.png differ