https://github.com/ngneat/subscribe
Subscription Handling Directive
https://github.com/ngneat/subscribe
angular subscribe subscription template
Last synced: 5 months ago
JSON representation
Subscription Handling Directive
- Host: GitHub
- URL: https://github.com/ngneat/subscribe
- Owner: ngneat
- License: mit
- Created: 2021-01-16T18:00:16.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-11-30T07:37:23.000Z (almost 3 years ago)
- Last Synced: 2025-04-29T21:23:54.378Z (5 months ago)
- Topics: angular, subscribe, subscription, template
- Language: TypeScript
- Homepage: https://netbasal.com/diy-subscription-handling-directive-in-angular-c8f6e762697f
- Size: 1.49 MB
- Stars: 35
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
[]()
[]()
[]()
[](https://github.com/prettier/prettier)
[](#contributors-1)
[](https://github.com/ngneat/)
[]()> Subscription Handling Directive
## Installation
`npm install @ngneat/subscribe`
## Usage
Now we can import the `SubscribeDirective` and use the `subscribe` directive in our template:```ts
import { SubscribeDirective } from '@ngneat/subscribe';@Component({
imports: [SubscribeDirective],
template: `
{{ users | json }}
{{ error }}
`
})
class MyComponent {
users$ = inject(UserService).getUsers();
}
```