The @HostBinding('ngIf') decorator must be in front of the property with the value to be bound.
export class MyDirective { constructor() {} @HostBinding('ngIf') ngif: boolean; @Input() serverWaiting:boolean = true; ngOnChanges() { this.ngif = !this.serverWaiting ? true : null; } }
This code does not look valid
<mySelector [serverWaiting]></mySelector>
[serverWaiting] indicates a property binding, but does not bind a value. This does not set true if you expect it. You will need
<mySelector [serverWaiting]="true"></mySelector>
source share