Function: MnComponent
▸ MnComponent<T
>(config
): (target
: T
) => void
Decorator that marks a class as a component and provides metadata that indicates where the component must be enabled at runtime.
Typeparam
T Component type
Example
Component that runs on all forms of the contact table.
@MnComponent({
scope: {
pageType: "record",
table: "contact"
}
})
export class ContactRecordComponent { }
Example
Component that runs on a specific form of the account table .
@MnComponent({
scope: {
pageType: "record",
table: "account",
form: {
id: "00000000-0000-0000-0000-000000000000"
}
}
})
export class AccountFormComponent { }
Example
Component that uses a service as dependency.
@Injectable()
export class AccountService { }
@MnComponent({
scope: {
pageType: "record",
table: "account"
},
providers: [{ provide: "accountService", useClass: AccountService }]
})
export class AccountComponent { }
For more information, see dependency injection
Type parameters
Name | Type |
---|---|
T | extends Constructor |
Parameters
Name | Type | Description |
---|---|---|
config | ComponentConfig | Component configuration |
Returns
fn
▸ (target
): void
Parameters
Name | Type |
---|---|
target | T |
Returns
void