emilol / angular-crumbs Goto Github PK
View Code? Open in Web Editor NEWAngular Breadcrumb
Home Page: https://emilol.github.io/angular-crumbs
License: MIT License
Angular Breadcrumb
Home Page: https://emilol.github.io/angular-crumbs
License: MIT License
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Feature request
[x] Documentation issue or request
Create a live demo including the most downloaded angular styling frameworks
Is there any reason why versions greater than 6 are excluded in package-dist.json
?
"@angular/*": ">=2.0.0 <7.0.0"
I would suggest changing peer dependencies to
"@angular/*": ">=2.0.0"
This is the way many other libraries do it (e.g. @ngx-translate/core
)
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
When a non-terminal route with a breadcrumb is modified using BreadcrumbService.changeBreadcrumb
, the custom breadcrumb name is only used when the route is terminal. If a child route is navigated to, the parent reverts to whatever is in route parameters.
app.route.ts
export const rootRouterConfig: Routes = [
...
{path: 'github', ..., data: { breadcrumb: 'GitHub'},
children: [
{path: '', ...},
{path: ':org', component: OrganisationComponent, data: { breadcrumb: 'Organisation'},
children: [
{path: '', ... },
{path: ':repo', ..., data: { breadcrumb: 'Repo'}}
]
}
]
}
];
organisation.component.ts
@Component({ ... })
export class OrganisationComponent {
organisation: { name?:string } = {};
ngOnInit() {
route.params.subscribe(params => {
this.setOrganisationCrumb(params['org']);
});
}
setOrganisationCrumb(organisationName: string) {
this.breadcrumbService.changeBreadcrumb(this.route.snapshot, organisationName);
}
}
#/github/Angular
, #/github/VueJs
GitHub > Angular
GitHub > VueJs
#/github/Angular/samples
, #/github/VueJs/vue
GitHub > Organisation > samples
GitHub > Organisation > vue
Always display the custom display name. e.g.
#/github/Angular/samples
, #/github/VueJs/vue
GitHub > Angular > samples
GitHub > VueJs > vue
Ok, I believe I had solved this problem. You need to change:
private createUrl(route: ActivatedRouteSnapshot) {
return route.url.map(function (s) { return s.toString(); }).join('/');
}
to
private createUrl(route: ActivatedRouteSnapshot) {
return route.url.map(s => s.path).join('/');
}
otherwise it will perform a URL encode twice.
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Feature request
[ ] Documentation issue or request
Angular version: X.Y.Z
Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: XX
- Platform:
Others:
Hi,
Could you pls help me how to achieve below breadcrumbs format ?
Users List > View User > John
in my view-user-component.ts
am calling breadcurmb service after resp like this
if(resp){
this.breadcrumbService.changeBreadcrumb(this.activatedRoute.snapshot, resp.firstName);
|
user-routing-module.ts
{ path: 'view-user/:id', component: ViewSelectedUsersComponent,
data: {
breadcrumb: 'View User'
}
},
Am able to see only Users List > John but i want show like Users List > View User > John
Pls help me on this
I have a strange situation I was hoping someone could help me with. When I navigate around in my application, everything works the way it is supposed to. But when I enter a url on the command line that contains a space in an argument, the router link in the breadcrumb is wrong.
Here is an example of my URL: http://localhost:12345/my-abs/trans/tran/AFG%202013-1/keymetrics
After entering the URL and going directly to the page, I hover over the parent breadcrumb link, and it shows this: http://localhost:12345/my-abs/trans/tran/AFG%25202013-1
...and of course if I click the link, the new route fails. It is putting an extra "25" in the link of the parent.
I would have had a go at fixing this myself (and sending you the changes), but it looks like this repository isn't the same one that feeds into angular2_crumbs in npm.
Hi emilol,
First of all, nice component, I´m currently using it within a real project and it works nice with just a few improvements.
I would like to propose the following improvement (Im at work and do not have much time to make a pull request):
private createBreadcrumb(route: ActivatedRouteSnapshot, url: string): Breadcrumb {
// Generates display text from data
// -- Dynamic route params when ':[id]'
let d = '';
const split = route.data['breadcrumb'].split(' ');
split.forEach((s: string) => {
d += `${s.indexOf(':') > -1 ? (route.params[s.slice(1)] ? route.params[s.slice(1)] : '') : s} `;
});
d = d.slice(0, -1);
return {
displayName: d,
terminal: this.isTerminal(route),
url: url,
route: route.routeConfig
};
}
{ path: 'home', ... , data: { breadcrumb: 'Home' } }
{ path: ':yearId/:monthId/:dayId', component: SubhomeComponent, data: { breadcrumb: 'SubHome with Year :id Month :monthId Day :dayId} }
Regards :)
Hi there, I was interested in using v2 and v3 but they are not published on npm. Will they be published?
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Feature request
[ ] Documentation issue or request
Angular version: X.Y.Z
Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: XX
- Platform:
Others:
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[x] Feature request
[ ] Documentation issue or request
After every route event, custom breadcrumb titles for the full hierarchy have to be set again.
If any part of the route stays the same, maintain the custom title.
I have to save any file and then works.
angular/cli 1.1.3
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
In my project most of my routes are lazy loaded, when I try to load the website for the first time the breadcrumb element displays nothing. but, after navigating to next page the breadcrumb element displays routes normally as usual.
breadcrumb element should display route breadcrumb data on website load even if route is lazy loaded
Angular version: X.Y.Z
Browser:
- [x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: v10.13.0
- Platform: Windows
Others:
ERROR in Error encountered resolving symbol values statically. Calling function 'BreadcrumbModule', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol AppModule in C:/project/src/app/app.module.ts, resolving symbol AppModule in C:/project/src/app/app.module.ts
If I save any files everything works.
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Feature request
[ ] Documentation issue or request
Dynamic Breadcrumb Change For Lazy loaded modules is not working
The Method changeBreadcrumb is not changing the breadcrumbs dynamically for lazy loaded modules
Angular version: X.Y.Z
Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: XX
- Platform:
Others:
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
I have copied your sample code and implemented in my project, breadcrumb is changing but child component is not loading. Even i checked in console there is not error. please suggest.
It should load child component.
{ path: 'overall', component: OverallPageComponent, data: { breadcrumb: 'Overall'},
children: [
{ path: 'project', component: ProjectPageComponent, data: { breadcrumb: 'Project'}}
]
}
Angular version: X.Y.Z
Browser:
- [X ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: XX V6.9.1
- Platform: Windows
Others:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.