{"id":20531929,"url":"https://github.com/celtian/ngx-nullable","last_synced_at":"2025-04-14T06:21:30.919Z","repository":{"id":259113217,"uuid":"876299123","full_name":"Celtian/ngx-nullable","owner":"Celtian","description":"This library provides a way to make properties nullable in Angular templates.","archived":false,"fork":false,"pushed_at":"2025-04-13T22:13:53.000Z","size":555,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-13T23:26:45.464Z","etag":null,"topics":["angular","library"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Celtian.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-10-21T18:24:50.000Z","updated_at":"2025-04-13T22:12:32.000Z","dependencies_parsed_at":"2025-04-13T23:22:02.361Z","dependency_job_id":"ed769b32-eda5-4333-bb58-3fb151509a4e","html_url":"https://github.com/Celtian/ngx-nullable","commit_stats":null,"previous_names":["celtian/ngx-nullable"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Celtian%2Fngx-nullable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Celtian%2Fngx-nullable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Celtian%2Fngx-nullable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Celtian%2Fngx-nullable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Celtian","download_url":"https://codeload.github.com/Celtian/ngx-nullable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248830884,"owners_count":21168361,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","library"],"created_at":"2024-11-16T00:11:03.090Z","updated_at":"2025-04-14T06:21:30.910Z","avatar_url":"https://github.com/Celtian.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/Celtian/ngx-nullable\" target=\"blank\"\u003e\u003cimg src=\"assets/logo.svg?sanitize=true\" alt=\"\" width=\"120\"\u003e\u003c/a\u003e\n  \u003ch1 align=\"center\"\u003eNgxNullable\u003c/h1\u003e\n\u003c/p\u003e\n\n[![npm version](https://badge.fury.io/js/ngx-nullable.svg)](https://badge.fury.io/js/ngx-nullable)\n[![Package License](https://img.shields.io/npm/l/ngx-nullable.svg)](https://www.npmjs.com/ngx-nullable)\n[![NPM Downloads](https://img.shields.io/npm/dm/ngx-nullable.svg)](https://www.npmjs.com/ngx-nullable)\n[![Snyk](https://snyk.io/advisor/npm-package/ngx-nullable/badge.svg)](https://snyk.io/advisor/npm-package/ngx-nullable)\n[![codecov](https://codecov.io/gh/Celtian/ngx-nullable/branch/master/graph/badge.svg?token=1IRUKIKM0D)](https://codecov.io/gh/celtian/ngx-nullable/)\n[![stars](https://badgen.net/github/stars/celtian/ngx-nullable)](https://github.com/celtian/ngx-nullable/)\n[![forks](https://badgen.net/github/forks/celtian/ngx-nullable)](https://github.com/celtian/ngx-nullable/)\n[![HitCount](http://hits.dwyl.com/celtian/ngx-nullable.svg)](http://hits.dwyl.com/celtian/ngx-nullable)\n\nThis library provides a way to make properties nullable in Angular templates.\n\n\u003e ✓ _Angular 19 compatible_\n\nHere's the [demo](http://celtian.github.io/ngx-nullable/)\n\n- Lightweight\n- No dependencies!\n\n## 🛠️ Install\n\n1. Use yarn (or npm) to install the package\n\n```terminal\nyarn add ngx-nullable\n```\n\n2. Add `provideNullable` into your config (optional)\n\n```typescript\nimport { provideNullable } from 'ngx-nullable';\n\nexport const appConfig: ApplicationConfig = {\n  providers: [\n    // ...\n    provideNullable({\n      character: '---',\n      separator: ' | ',\n      displayZero: true\n    })\n  ]\n};\n```\n\nor module\n\n```typescript\n  import { provideNullable } from 'ngx-nullable';\n\n  @NgModule({\n   // ...\n   providers: [\n     // ...\n     provideNullable({\n       character: '---',\n       separator: ' | ',\n       displayZero: true\n     })\n   ]\n  })\n```\n\n## 🚀 Quick start\n\n### Pipe example\n\n```html\n\u003cul\u003e\n  \u003cli\u003e{{ -1000 | ngxNullable }}\u003c/li\u003e\n  \u003cli\u003e{{ 1000 | ngxNullable }}\u003c/li\u003e\n  \u003cli\u003e{{ 0 | ngxNullable }}\u003c/li\u003e\n  \u003cli\u003e{{ null | ngxNullable }}\u003c/li\u003e\n  \u003cli\u003e{{ undefined | ngxNullable }}\u003c/li\u003e\n  \u003cli\u003e{{ 'string' | ngxNullable }}\u003c/li\u003e\n  \u003cli\u003e{{ '' | ngxNullable }}\u003c/li\u003e\n  \u003cli\u003e{{ ' ' | ngxNullable }}\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cul\u003e\n  \u003cli\u003e{{ ['', ' ', undefined, null] | ngxNullableJoin }}\u003c/li\u003e\n  \u003cli\u003e{{ ['AAA', 'BBB', 'CCC'] | ngxNullableJoin }}\u003c/li\u003e\n  \u003cli\u003e{{ ['AAA', '', ' ', undefined, null, 'BBB'] | ngxNullableJoin }}\u003c/li\u003e\n  \u003cli\u003e{{ [] | ngxNullableJoin }}\u003c/li\u003e\n\u003c/ul\u003e\n```\n\n### Signals example\n\n```Typescript\n\n@Component({\n  // ...\n})\nclass Example {\n  private readonly nullable = inject(NgxNullableService);\n  public readonly input = signal\u003cstring\u003e('');\n  public readonly computed = computed(() =\u003e this.nullable.fromString(this.input()));\n}\n\n```\n\n## 🛠️ Options\n\n### Root options\n\n| Option          | Type    | Default | Description                                                  |\n| --------------- | ------- | ------- | ------------------------------------------------------------ |\n| **character**   | string  | '—'     | The character to display when the value is null or undefined |\n| **separator**   | string  | ', '    | The separator to use when joining multiple values            |\n| **displayZero** | boolean | true    | Whether to display zero when the value is zero               |\n\n## 📦 Dependencies\n\n_None_\n\n## 🪪 License\n\nCopyright \u0026copy; 2024 - 2025 [Dominik Hladik](https://github.com/Celtian)\n\nAll contents are licensed under the [MIT license].\n\n[mit license]: LICENSE\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceltian%2Fngx-nullable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fceltian%2Fngx-nullable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fceltian%2Fngx-nullable/lists"}