Skip to content

Latest commit

 

History

History
34 lines (27 loc) · 1.24 KB

README.md

File metadata and controls

34 lines (27 loc) · 1.24 KB

MIT commitizen PRs styled with prettier All Contributors ngneat spectator

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();
}