
Research
Malicious fezbox npm Package Steals Browser Passwords from Cookies via Innovative QR Code Steganographic Technique
A malicious package uses a QR code as steganography in an innovative technique.
@molecule/pagination
Advanced tools
The structural molPagination
-Directive for Angular implements pagination of your data, but keeps you and your layout flexible.
You only need to focus on retrieving all items for your page, an observable indicating when to load the next page and one observable for when to hard-reload all data. Everything else is just your markup!
The following example is fully functional but relies on Ionic as it already implements pull to refresh and infinite scrolling. The molPagination
directive will concat each slice of data into a single array of data in the right order.
@Component({
template: `
<ion-content>
<!-- Pull to refresh -->
<ion-refresher (ionRefresh)="shouldReload($event)">
<ion-refresher-content></ion-refresher-content>
</ion-refresher>
<!-- Now let's use our directive -->
<ion-list *molPagination="itemsForPage; let allItems; ifLoading loadingRef; ifEmpty emptyRef; loadNext willLoadNext; hardReload willHardReload">
<!-- On Success -->
<!-- We can iterate over all items -->
<ion-item *ngFor="let item of allItems">
{{myItem}}
</ion-item>
</ion-list>
<!-- Displayed when loading -->
<ng-template #loadingRef>
<ion-spinner></ion-spinner>
</ng-template>
<!-- Displayed when there are no items at all -->
<ng-template #emptyRef>
Zero items
</ng-template>
<!-- Infinite scroll -->
<ion-infinite-scroll (ionInfinite)="shouldLoadNext($event)">
<ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll>
</ion-content>
`
})
@IonicPage()
export class MyItemsPage {
public readonly willHardReload = new Subject<void>();
public readonly willLoadNext = new Subject<void>();
private latestSender = () => void 0;
public get itemsForPage(): PageLoader<string> {
return (index, wasForced) => Observable.of([
`Values for page with index ${index} as array.`,
`If reload was forced, load from Http, otherwise from cache: ${wasForced}.`
])
.finally(() => this.latestSender()); // stop reload animation
}
public shouldReload(sender?: { complete: () => void }): void {
// store completion handler
this.latestSender = () => sender && sender.complete();
// emit hard reload event for pagination
this.willHardReload.next(void 0);
}
public shouldLoadNext(sender?: { complete: () => void }): void {
// store completion handler
this.latestSender = () => sender && sender.complete();
// emit request next page
this.willLoadNext.next(void 0);
}
}
$ npm install --save @molecule/pagination
Valentin Knabel, @vknabel, dev@vknabel.com
@molecule/pagination is available under the MIT license.
FAQs
A structural directive for pagination in Ionic and Angular.
We found that @molecule/pagination 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.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.
Application Security
/Research
/Security News
Socket detected multiple compromised CrowdStrike npm packages, continuing the "Shai-Hulud" supply chain attack that has now impacted nearly 500 packages.