Nopalws
ngx-unless
Angular library which is the opposite to *ngIf
, it also preserves the same context
Alien exists <!-- assuming -->Templated Alien existsElse Alien DOES NOT exists
Since falsy evaluated condition will be using the thenRef
, then you will get
Templated Alien Exists
Please note if we didn't get Alien exits
(the text inside the <p>
tag is because we added the then
context. that means if we don't provide then context like:
Alien exists
Then the output will be
Alien exists
Therefore
This Directive is an opposite version of
ngIf
, code ofngIf
directive was taken as base to make this version.
Positive statements enhance readability so instead of doing *ngIf="!isReady"
you use *ngxUnless="isReady