mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4152] Updated folder structure of core docs (#4415)
* [ADF-4152] Moved core library docs into subfolders * [ADF-4152] Moved core library docs into subfolders * [ADF-4152] Manual fixes to core doc file links * [ADF-4152] Further automatic + manual link tidying
This commit is contained in:
committed by
Eugenio Romano
parent
285e56e9fb
commit
5fc05da7aa
74
docs/core/components/comment-list.component.md
Normal file
74
docs/core/components/comment-list.component.md
Normal file
@@ -0,0 +1,74 @@
|
||||
---
|
||||
Title: Comment list component
|
||||
Added: v2.0.0
|
||||
Status: Active
|
||||
Last reviewed: 2018-11-14
|
||||
---
|
||||
|
||||
# [Comment list component](../../../lib/core/comments/comment-list.component.ts "Defined in comment-list.component.ts")
|
||||
|
||||
Shows a list of comments.
|
||||
|
||||

|
||||
|
||||
## Basic Usage
|
||||
|
||||
Populate the comments in the component class:
|
||||
|
||||
```ts
|
||||
import { CommentModel } from '@alfresco/adf-core';
|
||||
|
||||
export class SomeComponent implements OnInit {
|
||||
|
||||
comments: CommentModel[] = [
|
||||
{
|
||||
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: CommentModel) {
|
||||
console.log('Clicked row: ', comment);
|
||||
}
|
||||
```
|
||||
|
||||
In the component template use the [comment list component](comment-list.component.md):
|
||||
|
||||
```html
|
||||
<adf-comment-list
|
||||
[comments]="comments"
|
||||
(clickRow)="onClickCommentRow($event)">
|
||||
</adf-comment-list>
|
||||
```
|
||||
|
||||
## Class members
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Type | Default value | Description |
|
||||
| ---- | ---- | ------------- | ----------- |
|
||||
| comments | [`CommentModel`](../../../lib/core/models/comment.model.ts)`[]` | | The comments data used to populate the list. |
|
||||
|
||||
### Events
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| clickRow | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`CommentModel`](../../../lib/core/models/comment.model.ts)`>` | Emitted when the user clicks on one of the comment rows. |
|
Reference in New Issue
Block a user