@ngneat/subscribe
v4.0.0
Published
Subscription Handling Directive
Downloads
7,937
Maintainers
Readme
Subscription Handling Directive
Installation
npm install @ngneat/subscribe
Usage
Now we can import the SubscribeDirective
and use the subscribe
directive in our template:
import { SubscribeDirective } from '@ngneat/subscribe';
@Component({
imports: [SubscribeDirective],
template: `
<ng-container *subscribe="users$ as users; let error=error">
{{ users | json }}
{{ error }}
</ng-container>
`
})
class MyComponent {
users$ = inject(UserService).getUsers();
}