https://github.com/phenomnomnominal/ng-debug-pipes
Experimental hack for global pipes in Angular with Ivy
https://github.com/phenomnomnominal/ng-debug-pipes
Last synced: 3 months ago
JSON representation
Experimental hack for global pipes in Angular with Ivy
- Host: GitHub
- URL: https://github.com/phenomnomnominal/ng-debug-pipes
- Owner: phenomnomnominal
- Created: 2019-07-20T01:12:35.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T07:57:18.000Z (over 2 years ago)
- Last Synced: 2025-01-12T18:51:07.851Z (4 months ago)
- Language: TypeScript
- Size: 3.04 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 26
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ng-debug-pipes
## What is it? 🤔
This started with a few old pipes I had lying around, and quickly turned into me playing around with Ivy.
These pipes are kind of useful on their own:
**`DebugPipe`**:
```html
{{ foo | debug }}
```**`ConsolePipe`**
```html
{{ foo | console }}
```But the interesting thing here is the hack in `./projects/ng-debug-pipes/src/lib/global-pipe.ts`. It is *definitely* a hack, and very fragile, but it seems to enable you to use there pipes *anywhere in your application* without importing an `NgModule`! Even in a lazy loaded module!
## Running it 🏗
1) `ng build ng-debug-pipes`
2) `ng serve test-pipes`
## Caveats ⚠️
* Required the `"enableIvy": true` compiler option to be turned on.
* Breaks if you have full template type checking on. So you need to have `"fullTemplateTypeCheck": false`.