Subscription Handling Directive
Installation
npm install @ngneat/subscribe
Usage
First, we need to import the SubscribeModule
:
import { SubscribeModule } from '@ngneat/subscribe';
@NgModule({
imports: [SubscribeModule]
})
class MyModule {}
Now we can use the subscribe
directive in our template:
@Component({
template: `
<ng-container *subscribe="getUsers$; let users; let error=error">
{{ users | json }}
{{ error }}
</ng-container>
`
})
class MyComponent {
getUsers$ = this.service.getUsers();
constructor(private service: UserService) {}
}
Contributors ✨
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!