
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
ngx-simple-breadcrumb
Advanced tools
A tiny breadcrumb library for Angular. Under 40kb in size with no additional dependencies.
A tiny breadcrumb library for Angular. Under 40kb in size with no additional dependencies.
Add a breadcrumb to your Angular app in 5 minutes.
Version | Compatible Angular Version |
---|---|
17.x.x | >=17.0.0 |
16.x.x | >=16.0.0 |
npm install ngx-simple-breadcrumb
Import NgxSimpleBreadcrumbModule in your app module.
app.module.ts
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { RouterModule } from '@angular/router';
import { NgxSimpleBreadcrumbModule } from 'ngx-simple-breadcrumb';
@NgModule({
declarations: [
AppComponent
],
imports: [
...
NgxSimpleBreadcrumbModule,
RouterModule.forRoot([
...
])
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
app.component.html
<ngx-simple-breadcrumb>
<ng-template let-breadcrumb>
<a [routerLink]="breadcrumb.route">{{breadcrumb.label}}</a>
</ng-template>
<ng-template #separator> > </ng-template>
</ngx-simple-breadcrumb>
<router-outlet />
The first template defines each breadcrumb item. It can access the breadcrumb object by using let-breadcrumb
.
The breadcrumb object contains the following properties
The second template defines the separator which will separate each breadcrumb item. It must be identified by the template reference variable #seperator
.
These templates allow you the flexibility to add icons, images, styling etc. however you wish.
This value will be made available in your template as breadcrumb.label
.
app-routing.module.ts
[
{
path: 'child1',
component: Child1Component,
data: {breadcrumb: 'Child 1'},
children:
[{
path: 'grandchild1',
component: Grandchild1Component,
data: { breadcrumb: 'Grandchild 1' },
}]
},
{
path: 'child2',
component: Child2Component,
data: {breadcrumb: 'Child 2'},
}
]
Note the Angular behaviour that an empty path route inherits its parent's parameters and data.
This means if you add a breadcrumb to an empty path route (such as is common when lazy loading a module), its children will also inherit this breadcrumb and create duplicates. This can be avoided by only adding the breadcrumb data property to the children of empty path routes.
FAQs
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 uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.