Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/piecioshka/ngx-nullish
⚒ Angular Structural Directive which replace `*ngIf` by Nullish Coalescing operator.
https://github.com/piecioshka/ngx-nullish
angular coalescing directive ngif nullish structural
Last synced: 3 months ago
JSON representation
⚒ Angular Structural Directive which replace `*ngIf` by Nullish Coalescing operator.
- Host: GitHub
- URL: https://github.com/piecioshka/ngx-nullish
- Owner: piecioshka
- License: mit
- Created: 2020-06-20T22:17:25.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-12T18:36:28.000Z (3 months ago)
- Last Synced: 2024-10-12T21:49:12.197Z (3 months ago)
- Topics: angular, coalescing, directive, ngif, nullish, structural
- Language: TypeScript
- Homepage: https://piecioshka.github.io/ngx-nullish-demo/
- Size: 520 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- trackawesomelist - ngx-nullish (⭐2) - Angular Structural Directive, which replaces `*ngIf` with Nullish Coalescing operator. (Recently Updated / [Oct 20, 2024](/content/2024/10/20/README.md))
- awesome-angular - ngx-nullish - Angular Structural Directive, which replaces `*ngIf` with Nullish Coalescing operator. (Table of contents / Third Party Components)
- fucking-awesome-angular - ngx-nullish - Angular Structural Directive, which replaces `*ngIf` with Nullish Coalescing operator. (Table of contents / Third Party Components)
README
# ngx-nullish
[![node version](https://img.shields.io/node/v/ngx-nullish.svg)](https://www.npmjs.com/package/ngx-nullish)
[![npm version](https://badge.fury.io/js/ngx-nullish.svg)](https://badge.fury.io/js/ngx-nullish)
[![downloads count](https://img.shields.io/npm/dt/ngx-nullish.svg)](https://www.npmjs.com/package/ngx-nullish)
[![size](https://packagephobia.com/badge?p=ngx-nullish)](https://packagephobia.com/result?p=ngx-nullish)
[![license](https://img.shields.io/npm/l/ngx-nullish.svg)](https://piecioshka.mit-license.org)
[![github-ci](https://github.com/piecioshka/ngx-nullish/actions/workflows/testing.yml/badge.svg)](https://github.com/piecioshka/ngx-nullish/actions/workflows/testing.yml)🔨 Angular Structural Directive which replace `*ngIf` by **Nullish Coalescing** operator.
> Give a ⭐️ if this project helped you!
## Motivation
Nobody likes "Falsy Values".
When in your stream (RxJS) are numbers (include 0),
`*ngIf` will coerce `0` to `false`, means UI will not update.## Preview 🎉
## Features
* ✅ Returns **falsy** _only_ for: `null`, `undefined`
* `*ngIf` returns **falsy** for: `null`, `undefined`, `0`, `-0`, `false`, `NaN`, `''`## Installation
```bash
npm install ngx-nullish
```## Usage
1. Import deps
```javascript
import { NgxNullishModule } from 'ngx-nullish';@NgModule({
imports: [
...
NgxNullishModule
],
...
})
export class AppModule { }
```2. Update template
```html
{{ num }}
```replace to:
```html
{{ num }}
```## Deployment
Please run a script:
```bash
./scripts/deploy.sh
```## License
[The MIT License](https://piecioshka.mit-license.org) @ 2020