
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
@klippa/ngx-async-template
Advanced tools
Easily render templates based on the state of a promise: - inactive - pending - success - error
Easily render templates based on the state of a promise:
yarn add @klippa/ngx-async-template
npm install @klippa/ngx-async-template
I recommend importing the module in a generic ui module and then export it from there, so you can use the ngx-async-template everywhere in your app.
import { NgxAsyncTemplateModule } from '@klippa/ngx-async-template';
@NgModule({
imports: [
NgxAsyncTemplateModule,
],
exports: [
NgxAsyncTemplateModule,
],
providers: [{ provide: NgbDateParserFormatter, useClass: DateFormatComponent }],
})
export class UiModule {}
<ngx-async-template [promise]="userPromise">
<ng-template ngx-async-inactive>
loading not yet started
</ng-template>
<ng-template ngx-async-pending>
loading
</ng-template>
<ng-template ngx-async-success let-users="value">
result is {{users}}
</ng-template>
<ng-template ngx-async-error let-myErrors="errorMessages">
something went wrong {{myErrors}}
</ng-template>
<ng-template ngx-async-all let-myState="status">
Always rendered, state is {{myState}}
</ng-template>
</ngx-async-template>
To render templates, use one or more of the following directives on a ng-template
:
ngx-async-inactive
ngx-async-pending
ngx-async-success
ngx-async-error
ngx-async-all
You can extract the value of a successful promise by using let-someVarName="value"
where someVarName
can be any name you want.
To extract errors provided by a promise you can use let-myErrors="errorMessages"
where myErrors
can be any name you want.
You can also extract the status of a promise, which can be helpful if you have a template with multiple directives (<ng-template ngx-async-inactive ngx-async-pending...
) with let-myState="status"
where myState
can be any name you want.
FAQs
Easily render templates based on the state of a promise: - inactive - pending - success - error
The npm package @klippa/ngx-async-template receives a total of 49 weekly downloads. As such, @klippa/ngx-async-template popularity was classified as not popular.
We found that @klippa/ngx-async-template demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.