Skip to content

ngneat/subscribe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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