alfresco-ng2-components/docs/insights/widget.component.md
Andy Stark c1b12204f3 [ADF-3239] Fixed deprecated property descriptions (#3509)
* [ADF-3239] Changed deprecated properties to include full description

* [ADF-3239] Updated deprecated properties of affected doc files

* [ADF-3239] Fixed badly formatted doc comment in tasklist
2018-06-20 13:04:21 +01:00

50 lines
1.4 KiB
Markdown

---
Added: v2.0.0
Status: Active
Last reviewed: 2018-03-29
---
# Widget component
Base class for standard and custom widget classes.
## Basic Usage
```ts
import { Component } from '@angular/core';
import { WidgetComponent } from '@alfresco/adf-core';
@Component({
selector: 'custom-editor',
template: `
<div style="color: red">Look, I'm a custom editor!</div>
`
})
export class CustomEditorComponent extends WidgetComponent {}
```
## Class members
### Properties
| Name | Type | Default value | Description |
| -- | -- | -- | -- |
| field | [`FormFieldModel`](../core/form-field.model.md) | | Data to be displayed in the field |
| readOnly | `boolean` | false | Does the widget show a read-only value? (ie, can't be edited) |
### Events
| Name | Type | Description |
| -- | -- | -- |
| fieldChanged | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`FormFieldModel`](../core/form-field.model.md)`>` | (**Deprecated:** Used only to trigger visibility engine; components should do that internally if needed) |
## Details
The [Widget component](../insights/widget.component.md) is the base class for all standard and custom form widgets. See the
[Form Extensibility and Customisation](../user-guide/extensibility.md) page for full details about
implementing custom widgets.
## See also
- [Extensibility](../user-guide/extensibility.md)