Usage
Typescript Import Format
//To import this namespace, use the format below.
import {VComponentBinding} from "ojs/ojvcomponent-binding";
//This module also exports compiler decorators. To import a decorator use the named import format, for example:
import {consumeBinding} from "ojs/ojvcomponent-binding";
For additional information visit:
Decorators
-
@consumeBinding(consume)
-
Property decorator for VComponent that allows the property to consume a value provided by an ancestor component. The value will be consumed only if the property's attribute has not been set, i.e. the provided value is used as a default. The 'name' property should be set to the name of the variable published by an ancestor component.
Parameters:
Name Type Description consume{name: string} Options object that contains a name of the variable published by an ancestor component. -
@provideBinding(provide)
-
Property decorator for VComponent that allows the property to provide a value to be consumed by descendant components. Use multiple provideBinding decorators to provide more than one value to the descendants. See example above. The provided value will come from the literal attribute value, explicit expression binding or an implicit (consumed) binding provided by an ancestor component.
Parameters:
Name Type Description provideMetadataTypes.ProvideProperty Options object.