Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
angular-paginator
Advanced tools
Pagination for Angular applications
Install via package managers such as npm or yarn
npm install angular-paginator --save
# or
yarn add angular-paginator
Import the angular-paginator
module
import { AngularPaginatorModule } from 'angular-paginator';
@NgModule({
imports: [AngularPaginatorModule],
})
export class AppModule {}
and in the template
<div *ngFor="let item of array | angularPaginator: { currentPage: currentPage }; let i = index">
{{(currentPage - 1) * itemsPerPage + i +1}}. {{item}}
</div>
<angular-paginator (pageChange)="currentPage = $event"></angular-paginator>
The angularPaginator
pipe accepts
{
id: 'ANGULAR_PAGINATOR_DEFAULT',
itemsPerPage: 10,
currentPage: currentPage
}
ANGULAR_PAGINATOR_DEFAULT
when not specified. This is optional. Provide a unique id when multiple pagination instances are being used.[!IMPORTANT] When using an id, ensure to provide the same id in both the pipe and directive of the same instance.
<angular-paginator
id="ANGULAR_PAGINATOR_DEFAULT"
[maxSize]="5"
[rotate]="true"
[boundaryLinkNumbers]="false"
[forceEllipses]="false"
(pageChange)="currentPage = $event"
#paginator="angularPaginator"
>
</angular-paginator>
ANGULAR_PAGINATOR_DEFAULT
when not specified. This is optional. This must be provided if the id is specified in the pipe and should be the same as the pipe id[!NOTE] maxSize refers to the center of the range. This option may add up to 2 more numbers on each side of the displayed range for the end value and what would be an ellipsis but is replaced by a number because it is sequential
You can get access to the pagination instance(directive's api) using #paginator="angularPaginator"
. The following are the methods/properties available via the API
interface Page {
number: number;
text: string;
active: boolean;
}
currentPage - 1
)currentPage + 1
)FAQs
Pagination for Angular Applications
The npm package angular-paginator receives a total of 330 weekly downloads. As such, angular-paginator popularity was classified as not popular.
We found that angular-paginator demonstrated a healthy version release cadence and project activity because the last version was released less than 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
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.