Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
angular2-busy-directive
Advanced tools
This is a simple package which can show a loading indicator based on an observable.
The package comes with a default loading component. However it is possible to inject your own.
npm i --save angular2-busy-directive
First thing you need to do is import the BusyModule
into your root module.
@NgModule({
declarations: [...]
imports: [
BusyModule,
...
],
providers: [...]
})
export class AppModule {
}
The second thing you need to do is use the rvBusy
directive on an html tag.
@Component({
selector: 'app-sample',
template: `
<div [rvBusy]="locations$">
<pre>{{locations$ | async}}</pre>
</div>
`
})
class SampleComponent implements OnInit {
locations$: Observable<any>;
constructor(private http: HttpClient) {}
ngOnInit() {
this.busy = this.http.get('...');
}
}
That's all!
To inject your own loading component you have to do the following.
Declare your component in the entryComponents
of your root module.
@NgModule({
declarations: [...]
imports: [
BusyModule,
...
],
entryComponents: [
MyCustomComponent
],
providers: [...]
})
export class AppModule {
}
Inject your component into the directive rvComponent
.
@Component({
selector: 'app-sample',
template: `
<div [rvBusy]="locations$" [rvComponent]="component">
<pre>{{locations$ | async}}</pre>
</div>
`
})
class SampleComponent implements OnInit {
locations$: Observable<any>;
component = MyCustomComponent;
constructor(private http: HttpClient) {}
ngOnInit() {
this.busy = this.http.get('...');
}
}
FAQs
Show a loading indicator based on observables.
The npm package angular2-busy-directive receives a total of 0 weekly downloads. As such, angular2-busy-directive popularity was classified as not popular.
We found that angular2-busy-directive demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.