I am trying to pass some value in my custom Directive but when trying to do so, I am getting error
home.component.ts
<div *myNgIf myNgIfSomething="true" class="col-sm-6">
<div class="form-group">
<label for="lname">LastName</label>
<input class="form-control" type="text" name="lname">
</div>
</div>
Directive
@Directive({
selector: '[myNgIf]'
})
export class myNgIfDirective implements AfterViewInit {
@Input() myNgIfSomething: boolean = false;
constructor(private container: ViewContainerRef, private template: TemplateRef<any>) { }
ngAfterViewInit(): void {
if(this.myNgIfSomething){
this.container.createEmbeddedView(this.template)
}else{
this.container.clear()
}
}
}
error