ngx-decorate
Version:
Useful decorators for Angular 2 and above
14 lines (13 loc) • 514 B
TypeScript
export interface SubscribeToConfig {
/** Property at which the change detector resides */
cdrProp?: PropertyKey;
}
/**
* Subscribe to an observable and set its last emitted value to this property
*
* This decorator requires the ngOnInit hook and therefore will only work with directives and components.
*
* @param prop Property at which the observable resides
* @param cfg Optional configuration
*/
export declare function SubscribeTo(prop: PropertyKey, cfg?: SubscribeToConfig): PropertyDecorator;