Why is the call to buildBreadCrumb called from the constructor and component lifecycle method? If you remove from the designer, then the breadcrumbs are not displayed? It’s not clear to everyone why this is happening.
The buildBreadCrumb in the constructor is the initial build for breadcrumb when the application is loaded.
The buildBreadCrumb in onInit is actually in a subscription to a router change. It means that the breadcrumb is always re-built when there is a router change. Because if some modules are lazy loaded, you wouldn't have their routes in the beginning.
Hope that clarifies :)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Why is the call to buildBreadCrumb called from the constructor and component lifecycle method? If you remove from the designer, then the breadcrumbs are not displayed? It’s not clear to everyone why this is happening.
The buildBreadCrumb in the constructor is the initial build for breadcrumb when the application is loaded.
The buildBreadCrumb in onInit is actually in a subscription to a router change. It means that the breadcrumb is always re-built when there is a router change. Because if some modules are lazy loaded, you wouldn't have their routes in the beginning.
Hope that clarifies :)