1
0

Added Edit + Create comment funtionality

This commit is contained in:
2020-04-11 20:39:10 -04:00
parent a55c555138
commit c9ec00e984
21 changed files with 330 additions and 46 deletions

View File

@@ -0,0 +1,34 @@
import {
Directive,
Input,
OnInit,
TemplateRef,
ViewContainerRef
} from '@angular/core';
export class NgLetContext {
$implicit: any = undefined;
ngLet: any = undefined;
}
@Directive({
// tslint:disable-next-line:directive-selector
selector: '[ngLet]'
})
export class NgLetDirective implements OnInit {
private readonly _context = new NgLetContext();
@Input()
set ngLet(value: any) {
this._context.$implicit = this._context.ngLet = value;
}
constructor(
private readonly _vcr: ViewContainerRef,
private readonly _templateRef: TemplateRef<NgLetContext>
) { }
ngOnInit(): void {
this._vcr.createEmbeddedView(this._templateRef, this._context);
}
}