mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-1586] CommentListComponent documentation (#2650)
This commit is contained in:
committed by
Denys Vuika
parent
6da6d216e1
commit
6f282c051e
69
docs/comment-list.component.md
Normal file
69
docs/comment-list.component.md
Normal file
@@ -0,0 +1,69 @@
|
||||
# Comment list component
|
||||
Shows a list of comments.
|
||||
|
||||

|
||||
|
||||
## 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
|
||||
<adf-comment-list
|
||||
[comments]="comments"
|
||||
(clickRow)="onClickCommentRow($event)">
|
||||
</adf-comment-list>
|
||||
```
|
||||
|
||||
### 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 |
|
||||
|
||||
|
||||
<!-- seealso start -->
|
||||
|
||||
<!-- seealso end -->
|
BIN
docs/docassets/images/adf-comment-list.png
Normal file
BIN
docs/docassets/images/adf-comment-list.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 24 KiB |
Reference in New Issue
Block a user