worker-calendar
Version:
A customizable, responsive Angular calendar component for scheduling worker appointments or shifts
20 lines (18 loc) • 559 B
text/typescript
import { Directive, Input, TemplateRef, ViewContainerRef } from '@angular/core';
// This directive allows using of variables in templates
({
selector: '[ngVar]'
})
export class NgVarDirective {
()
set ngVar(context: any) {
this.viewContainer.clear();
if (context !== null && context !== undefined) {
this.viewContainer.createEmbeddedView(this.templateRef, { $implicit: context });
}
}
constructor(
private templateRef: TemplateRef<any>,
private viewContainer: ViewContainerRef
) { }
}