├── src
├── assets
│ ├── .gitkeep
│ ├── cairo.jpg
│ ├── giza.jpg
│ ├── berlin.jpg
│ └── hamburg.jpg
├── app
│ ├── app.component.scss
│ ├── breadcrumb
│ │ ├── breadcrumb.component.scss
│ │ ├── breadcrumb.component.html
│ │ └── breadcrumb.component.ts
│ ├── app.component.html
│ ├── africa
│ │ ├── egypt
│ │ │ ├── cairo
│ │ │ │ ├── cairo.component.html
│ │ │ │ └── cairo.component.ts
│ │ │ ├── giza
│ │ │ │ ├── giza.component.html
│ │ │ │ └── giza.component.ts
│ │ │ ├── egypt.component.html
│ │ │ └── egypt.component.ts
│ │ ├── african-countries
│ │ │ ├── african-countries.component.html
│ │ │ └── african-countries.component.ts
│ │ ├── africa.module.ts
│ │ └── africa-routing.module.ts
│ ├── europe
│ │ ├── germany
│ │ │ ├── berlin
│ │ │ │ ├── berlin.component.html
│ │ │ │ └── berlin.component.ts
│ │ │ ├── hambrug
│ │ │ │ ├── hamburg.component.html
│ │ │ │ └── hamburg.component.ts
│ │ │ ├── germany.component.html
│ │ │ └── germany.component.ts
│ │ ├── european-countries
│ │ │ ├── european-countries.component.html
│ │ │ └── european-countries.component.ts
│ │ ├── europe.module.ts
│ │ └── europe-routing.module.ts
│ ├── home
│ │ ├── home
│ │ │ ├── home.component.scss
│ │ │ ├── home.component.ts
│ │ │ └── home.component.html
│ │ ├── home.module.ts
│ │ └── home-routing.module.ts
│ ├── app.component.ts
│ ├── app.module.ts
│ ├── app-routing.module.ts
│ └── app.component.spec.ts
├── environments
│ ├── environment.prod.ts
│ └── environment.ts
├── favicon.ico
├── tsconfig.app.json
├── tsconfig.spec.json
├── index.html
├── tslint.json
├── main.ts
├── browserslist
├── styles.scss
├── test.ts
├── karma.conf.js
└── polyfills.ts
├── e2e
├── tsconfig.e2e.json
├── src
│ ├── app.po.ts
│ └── app.e2e-spec.ts
└── protractor.conf.js
├── .editorconfig
├── tsconfig.json
├── .gitignore
├── README.md
├── package.json
├── tslint.json
└── angular.json
/src/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app/app.component.scss:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/app/breadcrumb/breadcrumb.component.scss:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/src/app/app.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | export const environment = {
2 | production: true
3 | };
4 |
--------------------------------------------------------------------------------
/src/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piotrkorlaga/demo-angular-breadcrumb/HEAD/src/favicon.ico
--------------------------------------------------------------------------------
/src/assets/cairo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piotrkorlaga/demo-angular-breadcrumb/HEAD/src/assets/cairo.jpg
--------------------------------------------------------------------------------
/src/assets/giza.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piotrkorlaga/demo-angular-breadcrumb/HEAD/src/assets/giza.jpg
--------------------------------------------------------------------------------
/src/app/africa/egypt/cairo/cairo.component.html:
--------------------------------------------------------------------------------
1 |
2 |

3 |
4 |
--------------------------------------------------------------------------------
/src/app/africa/egypt/giza/giza.component.html:
--------------------------------------------------------------------------------
1 |
2 |

3 |
4 |
--------------------------------------------------------------------------------
/src/app/breadcrumb/breadcrumb.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/src/assets/berlin.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piotrkorlaga/demo-angular-breadcrumb/HEAD/src/assets/berlin.jpg
--------------------------------------------------------------------------------
/src/assets/hamburg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/piotrkorlaga/demo-angular-breadcrumb/HEAD/src/assets/hamburg.jpg
--------------------------------------------------------------------------------
/src/app/europe/germany/berlin/berlin.component.html:
--------------------------------------------------------------------------------
1 |
2 |

3 |
4 |
--------------------------------------------------------------------------------
/src/app/europe/germany/hambrug/hamburg.component.html:
--------------------------------------------------------------------------------
1 |
2 |

3 |
4 |
--------------------------------------------------------------------------------
/src/app/home/home/home.component.scss:
--------------------------------------------------------------------------------
1 | .welcome{
2 | text-align: center;
3 | width: 100%;
4 | color: burlywood;
5 | }
6 |
--------------------------------------------------------------------------------
/src/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/app",
5 | "types": []
6 | },
7 | "exclude": [
8 | "test.ts",
9 | "**/*.spec.ts"
10 | ]
11 | }
12 |
--------------------------------------------------------------------------------
/src/app/africa/egypt/egypt.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 | -
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/src/app/europe/germany/germany.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 | -
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/e2e/tsconfig.e2e.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/app",
5 | "module": "commonjs",
6 | "target": "es5",
7 | "types": [
8 | "jasmine",
9 | "jasminewd2",
10 | "node"
11 | ]
12 | }
13 | }
--------------------------------------------------------------------------------
/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import { Component } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-root',
5 | templateUrl: './app.component.html',
6 | styleUrls: ['./app.component.scss']
7 | })
8 | export class AppComponent {
9 | title = 'demo-angular-breadcrumb';
10 | }
11 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see https://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.md]
12 | max_line_length = off
13 | trim_trailing_whitespace = false
14 |
--------------------------------------------------------------------------------
/e2e/src/app.po.ts:
--------------------------------------------------------------------------------
1 | import { browser, by, element } from 'protractor';
2 |
3 | export class AppPage {
4 | navigateTo() {
5 | return browser.get(browser.baseUrl) as Promise;
6 | }
7 |
8 | getTitleText() {
9 | return element(by.css('app-root h1')).getText() as Promise;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/app/africa/egypt/egypt.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-egypt',
5 | templateUrl: './egypt.component.html'
6 | })
7 | export class EgyptComponent implements OnInit {
8 |
9 | constructor() { }
10 |
11 | ngOnInit() {
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/src/app/africa/egypt/giza/giza.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-giza',
5 | templateUrl: './giza.component.html'
6 | })
7 | export class GizaComponent implements OnInit {
8 |
9 | constructor() { }
10 |
11 | ngOnInit() {
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/src/app/africa/egypt/cairo/cairo.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-cairo',
5 | templateUrl: './cairo.component.html'
6 | })
7 | export class CairoComponent implements OnInit {
8 |
9 | constructor() { }
10 |
11 | ngOnInit() {
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/src/app/europe/germany/berlin/berlin.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-cairo',
5 | templateUrl: './berlin.component.html',
6 | })
7 | export class BerlinComponent implements OnInit {
8 |
9 | constructor() { }
10 |
11 | ngOnInit() {
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/src/app/europe/germany/germany.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-egypt',
5 | templateUrl: './germany.component.html',
6 | })
7 | export class GermanyComponent implements OnInit {
8 |
9 | constructor() { }
10 |
11 | ngOnInit() {
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/src/app/europe/germany/hambrug/hamburg.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-giza',
5 | templateUrl: './hamburg.component.html',
6 | })
7 | export class HamburgComponent implements OnInit {
8 |
9 | constructor() { }
10 |
11 | ngOnInit() {
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/src/app/europe/european-countries/european-countries.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 | France
7 | Spain
8 | Portugal
9 | Italy
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/app/home/home/home.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-home',
5 | templateUrl: './home.component.html',
6 | styleUrls: ['./home.component.scss']
7 | })
8 | export class HomeComponent implements OnInit {
9 |
10 | constructor() { }
11 |
12 | ngOnInit() {
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/src/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../out-tsc/spec",
5 | "types": [
6 | "jasmine",
7 | "node"
8 | ]
9 | },
10 | "files": [
11 | "test.ts",
12 | "polyfills.ts"
13 | ],
14 | "include": [
15 | "**/*.spec.ts",
16 | "**/*.d.ts"
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/src/app/africa/african-countries/african-countries.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 | Nigeria
7 | Ethiopia
8 | Democratic Republic of the Congo
9 | South Africa
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | DemoAngularBreadcrumb
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/app/africa/african-countries/african-countries.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-african-countries',
5 | templateUrl: './african-countries.component.html'
6 | })
7 | export class AfricanCountriesComponent implements OnInit {
8 |
9 | constructor() { }
10 |
11 | ngOnInit() {
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/src/app/europe/european-countries/european-countries.component.ts:
--------------------------------------------------------------------------------
1 | import { Component, OnInit } from '@angular/core';
2 |
3 | @Component({
4 | selector: 'app-african-countries',
5 | templateUrl: './european-countries.component.html',
6 | })
7 | export class EuropeanCountriesComponent implements OnInit {
8 |
9 | constructor() { }
10 |
11 | ngOnInit() {
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/src/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../tslint.json",
3 | "rules": {
4 | "directive-selector": [
5 | true,
6 | "attribute",
7 | "app",
8 | "camelCase"
9 | ],
10 | "component-selector": [
11 | true,
12 | "element",
13 | "app",
14 | "kebab-case"
15 | ]
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/app/home/home.module.ts:
--------------------------------------------------------------------------------
1 | import {NgModule} from '@angular/core';
2 | import {CommonModule} from '@angular/common';
3 | import {HomeComponent} from './home/home.component';
4 | import {HomeRoutingModule} from './home-routing.module';
5 |
6 | @NgModule({
7 | declarations: [HomeComponent],
8 | imports: [
9 | CommonModule,
10 | HomeRoutingModule
11 | ]
12 | })
13 | export class HomeModule { }
14 |
--------------------------------------------------------------------------------
/src/app/home/home/home.component.html:
--------------------------------------------------------------------------------
1 | Welcome to World Explorer!
2 |
3 |
4 |
5 | Asia
6 | Australia
7 |
8 | North America
9 | South America
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/main.ts:
--------------------------------------------------------------------------------
1 | import { enableProdMode } from '@angular/core';
2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
3 |
4 | import { AppModule } from './app/app.module';
5 | import { environment } from './environments/environment';
6 |
7 | if (environment.production) {
8 | enableProdMode();
9 | }
10 |
11 | platformBrowserDynamic().bootstrapModule(AppModule)
12 | .catch(err => console.error(err));
13 |
--------------------------------------------------------------------------------
/src/browserslist:
--------------------------------------------------------------------------------
1 | # This file is currently used by autoprefixer to adjust CSS to support the below specified browsers
2 | # For additional information regarding the format and rule options, please see:
3 | # https://github.com/browserslist/browserslist#queries
4 | #
5 | # For IE 9-11 support, please remove 'not' from the last line of the file and adjust as needed
6 |
7 | > 0.5%
8 | last 2 versions
9 | Firefox ESR
10 | not dead
11 | not IE 9-11
--------------------------------------------------------------------------------
/src/styles.scss:
--------------------------------------------------------------------------------
1 | .image{
2 | text-align: center;
3 | width: 100%;
4 | }
5 |
6 |
7 | .nav {
8 | text-align: center;
9 | width: 100%;
10 |
11 | ul {
12 | list-style: none;
13 | padding: 0;
14 | li{
15 | display: inline-block;
16 | padding: 10px;
17 | }
18 | }
19 | }
20 |
21 | .headline{
22 | text-align: center;
23 | width: 100%;
24 | color: lightgray;
25 | }
26 |
27 | p-breadcrumb{
28 | margin: 20px;
29 | }
30 |
--------------------------------------------------------------------------------
/src/app/home/home-routing.module.ts:
--------------------------------------------------------------------------------
1 | import {NgModule} from '@angular/core';
2 | import {RouterModule, Routes} from '@angular/router';
3 | import {HomeComponent} from './home/home.component';
4 |
5 | const routes: Routes = [
6 | {
7 | path: '',
8 | data: {
9 | breadcrumb: 'Home'
10 | },
11 | component: HomeComponent
12 | }
13 | ];
14 |
15 |
16 | @NgModule({
17 | imports: [RouterModule.forChild(routes)],
18 | exports: [RouterModule]
19 | })
20 | export class HomeRoutingModule {
21 | }
22 |
23 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compileOnSave": false,
3 | "compilerOptions": {
4 | "baseUrl": "./",
5 | "outDir": "./dist/out-tsc",
6 | "sourceMap": true,
7 | "declaration": false,
8 | "module": "es2015",
9 | "moduleResolution": "node",
10 | "emitDecoratorMetadata": true,
11 | "experimentalDecorators": true,
12 | "importHelpers": true,
13 | "target": "es5",
14 | "typeRoots": [
15 | "node_modules/@types"
16 | ],
17 | "lib": [
18 | "es2018",
19 | "dom"
20 | ]
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import {BrowserModule} from '@angular/platform-browser';
2 | import {NgModule} from '@angular/core';
3 |
4 | import {AppRoutingModule} from './app-routing.module';
5 | import {AppComponent} from './app.component';
6 | import {BreadcrumbComponent} from './breadcrumb/breadcrumb.component';
7 | import {BreadcrumbModule} from 'primeng/primeng';
8 |
9 | @NgModule({
10 | declarations: [
11 | AppComponent,
12 | BreadcrumbComponent
13 | ],
14 | imports: [
15 | BrowserModule,
16 | AppRoutingModule,
17 | BreadcrumbModule
18 | ],
19 | providers: [],
20 | bootstrap: [AppComponent]
21 | })
22 | export class AppModule { }
23 |
--------------------------------------------------------------------------------
/src/app/africa/africa.module.ts:
--------------------------------------------------------------------------------
1 | import {NgModule} from '@angular/core';
2 | import {CommonModule} from '@angular/common';
3 | import {AfricanCountriesComponent} from './african-countries/african-countries.component';
4 | import {AfricaRoutingModule} from './africa-routing.module';
5 | import {EgyptComponent} from './egypt/egypt.component';
6 | import {CairoComponent} from './egypt/cairo/cairo.component';
7 | import {GizaComponent} from './egypt/giza/giza.component';
8 |
9 | @NgModule({
10 | declarations: [AfricanCountriesComponent, EgyptComponent, CairoComponent, GizaComponent],
11 | imports: [
12 | CommonModule,
13 | AfricaRoutingModule
14 | ]
15 | })
16 | export class AfricaModule { }
17 |
--------------------------------------------------------------------------------
/src/app/europe/europe.module.ts:
--------------------------------------------------------------------------------
1 | import {NgModule} from '@angular/core';
2 | import {CommonModule} from '@angular/common';
3 | import {EuropeanCountriesComponent} from './european-countries/european-countries.component';
4 | import {EuropeRoutingModule} from './europe-routing.module';
5 | import {GermanyComponent} from './germany/germany.component';
6 | import {BerlinComponent} from './germany/berlin/berlin.component';
7 | import {HamburgComponent} from './germany/hambrug/hamburg.component';
8 |
9 | @NgModule({
10 | declarations: [EuropeanCountriesComponent, GermanyComponent, BerlinComponent, HamburgComponent],
11 | imports: [
12 | CommonModule,
13 | EuropeRoutingModule
14 | ]
15 | })
16 | export class EuropeModule { }
17 |
--------------------------------------------------------------------------------
/src/test.ts:
--------------------------------------------------------------------------------
1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2 |
3 | import 'zone.js/dist/zone-testing';
4 | import { getTestBed } from '@angular/core/testing';
5 | import {
6 | BrowserDynamicTestingModule,
7 | platformBrowserDynamicTesting
8 | } from '@angular/platform-browser-dynamic/testing';
9 |
10 | declare const require: any;
11 |
12 | // First, initialize the Angular testing environment.
13 | getTestBed().initTestEnvironment(
14 | BrowserDynamicTestingModule,
15 | platformBrowserDynamicTesting()
16 | );
17 | // Then we find all the tests.
18 | const context = require.context('./', true, /\.spec\.ts$/);
19 | // And load the modules.
20 | context.keys().map(context);
21 |
--------------------------------------------------------------------------------
/src/environments/environment.ts:
--------------------------------------------------------------------------------
1 | // This file can be replaced during build by using the `fileReplacements` array.
2 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
3 | // The list of file replacements can be found in `angular.json`.
4 |
5 | export const environment = {
6 | production: false
7 | };
8 |
9 | /*
10 | * For easier debugging in development mode, you can import the following file
11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
12 | *
13 | * This import should be commented out in production mode because it will have a negative impact
14 | * on performance if an error is thrown.
15 | */
16 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI.
17 |
--------------------------------------------------------------------------------
/e2e/src/app.e2e-spec.ts:
--------------------------------------------------------------------------------
1 | import { AppPage } from './app.po';
2 | import { browser, logging } from 'protractor';
3 |
4 | describe('workspace-project App', () => {
5 | let page: AppPage;
6 |
7 | beforeEach(() => {
8 | page = new AppPage();
9 | });
10 |
11 | it('should display welcome message', () => {
12 | page.navigateTo();
13 | expect(page.getTitleText()).toEqual('Welcome to demo-angular-breadcrumb!');
14 | });
15 |
16 | afterEach(async () => {
17 | // Assert that there are no errors emitted from the browser
18 | const logs = await browser.manage().logs().get(logging.Type.BROWSER);
19 | expect(logs).not.toContain(jasmine.objectContaining({
20 | level: logging.Level.SEVERE,
21 | } as logging.Entry));
22 | });
23 | });
24 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See http://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # compiled output
4 | /dist
5 | /tmp
6 | /out-tsc
7 | # Only exists if Bazel was run
8 | /bazel-out
9 |
10 | # dependencies
11 | /node_modules
12 |
13 | # profiling files
14 | chrome-profiler-events.json
15 | speed-measure-plugin.json
16 |
17 | # IDEs and editors
18 | /.idea
19 | .project
20 | .classpath
21 | .c9/
22 | *.launch
23 | .settings/
24 | *.sublime-workspace
25 |
26 | # IDE - VSCode
27 | .vscode/*
28 | !.vscode/settings.json
29 | !.vscode/tasks.json
30 | !.vscode/launch.json
31 | !.vscode/extensions.json
32 | .history/*
33 |
34 | # misc
35 | /.sass-cache
36 | /connect.lock
37 | /coverage
38 | /libpeerconnection.log
39 | npm-debug.log
40 | yarn-error.log
41 | testem.log
42 | /typings
43 |
44 | # System Files
45 | .DS_Store
46 | Thumbs.db
47 |
--------------------------------------------------------------------------------
/src/app/app-routing.module.ts:
--------------------------------------------------------------------------------
1 | import {NgModule} from '@angular/core';
2 | import {RouterModule, Routes} from '@angular/router';
3 |
4 |
5 | const appRoutes: Routes = [
6 | {
7 | path: '',
8 | children: [
9 | {path: '', redirectTo: '/home', pathMatch: 'full'},
10 | {
11 | path: 'home',
12 | loadChildren: 'src/app/home/home.module#HomeModule'
13 | },
14 | {
15 | path: 'africa',
16 | loadChildren: 'src/app/africa/africa.module#AfricaModule'
17 | },
18 | {
19 | path: 'europe',
20 | loadChildren: 'src/app/europe/europe.module#EuropeModule'
21 | }
22 | ]
23 | }
24 | ];
25 |
26 | @NgModule({
27 | imports: [RouterModule.forRoot(appRoutes, {useHash: true})],
28 | exports: [RouterModule]
29 | })
30 | export class AppRoutingModule {
31 | }
32 |
33 |
--------------------------------------------------------------------------------
/e2e/protractor.conf.js:
--------------------------------------------------------------------------------
1 | // Protractor configuration file, see link for more information
2 | // https://github.com/angular/protractor/blob/master/lib/config.ts
3 |
4 | const { SpecReporter } = require('jasmine-spec-reporter');
5 |
6 | exports.config = {
7 | allScriptsTimeout: 11000,
8 | specs: [
9 | './src/**/*.e2e-spec.ts'
10 | ],
11 | capabilities: {
12 | 'browserName': 'chrome'
13 | },
14 | directConnect: true,
15 | baseUrl: 'http://localhost:4200/',
16 | framework: 'jasmine',
17 | jasmineNodeOpts: {
18 | showColors: true,
19 | defaultTimeoutInterval: 30000,
20 | print: function() {}
21 | },
22 | onPrepare() {
23 | require('ts-node').register({
24 | project: require('path').join(__dirname, './tsconfig.e2e.json')
25 | });
26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
27 | }
28 | };
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # DemoAngularBreadcrumb
2 |
3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 7.3.2.
4 |
5 | ## Development server
6 |
7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
8 |
9 | ## Code scaffolding
10 |
11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
12 |
13 | ## Build
14 |
15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
16 |
17 | ## Running unit tests
18 |
19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20 |
21 | ## Running end-to-end tests
22 |
23 | Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
24 |
25 | ## Further help
26 |
27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
28 |
--------------------------------------------------------------------------------
/src/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration file, see link for more information
2 | // https://karma-runner.github.io/1.0/config/configuration-file.html
3 |
4 | module.exports = function (config) {
5 | config.set({
6 | basePath: '',
7 | frameworks: ['jasmine', '@angular-devkit/build-angular'],
8 | plugins: [
9 | require('karma-jasmine'),
10 | require('karma-chrome-launcher'),
11 | require('karma-jasmine-html-reporter'),
12 | require('karma-coverage-istanbul-reporter'),
13 | require('@angular-devkit/build-angular/plugins/karma')
14 | ],
15 | client: {
16 | clearContext: false // leave Jasmine Spec Runner output visible in browser
17 | },
18 | coverageIstanbulReporter: {
19 | dir: require('path').join(__dirname, '../coverage/demo-angular-breadcrumb'),
20 | reports: ['html', 'lcovonly', 'text-summary'],
21 | fixWebpackSourcePaths: true
22 | },
23 | reporters: ['progress', 'kjhtml'],
24 | port: 9876,
25 | colors: true,
26 | logLevel: config.LOG_INFO,
27 | autoWatch: true,
28 | browsers: ['Chrome'],
29 | singleRun: false,
30 | restartOnFileChange: true
31 | });
32 | };
33 |
--------------------------------------------------------------------------------
/src/app/app.component.spec.ts:
--------------------------------------------------------------------------------
1 | import { TestBed, async } from '@angular/core/testing';
2 | import { RouterTestingModule } from '@angular/router/testing';
3 | import { AppComponent } from './app.component';
4 |
5 | describe('AppComponent', () => {
6 | beforeEach(async(() => {
7 | TestBed.configureTestingModule({
8 | imports: [
9 | RouterTestingModule
10 | ],
11 | declarations: [
12 | AppComponent
13 | ],
14 | }).compileComponents();
15 | }));
16 |
17 | it('should create the app', () => {
18 | const fixture = TestBed.createComponent(AppComponent);
19 | const app = fixture.debugElement.componentInstance;
20 | expect(app).toBeTruthy();
21 | });
22 |
23 | it(`should have as title 'demo-angular-breadcrumb'`, () => {
24 | const fixture = TestBed.createComponent(AppComponent);
25 | const app = fixture.debugElement.componentInstance;
26 | expect(app.title).toEqual('demo-angular-breadcrumb');
27 | });
28 |
29 | it('should render title in a h1 tag', () => {
30 | const fixture = TestBed.createComponent(AppComponent);
31 | fixture.detectChanges();
32 | const compiled = fixture.debugElement.nativeElement;
33 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to demo-angular-breadcrumb!');
34 | });
35 | });
36 |
--------------------------------------------------------------------------------
/src/app/africa/africa-routing.module.ts:
--------------------------------------------------------------------------------
1 | import {NgModule} from '@angular/core';
2 | import {RouterModule, Routes} from '@angular/router';
3 | import {AfricanCountriesComponent} from './african-countries/african-countries.component';
4 | import {EgyptComponent} from './egypt/egypt.component';
5 | import {CairoComponent} from './egypt/cairo/cairo.component';
6 | import {GizaComponent} from './egypt/giza/giza.component';
7 |
8 | const routes: Routes = [
9 | {
10 | path: '',
11 | data: {
12 | breadcrumb: 'Africa'
13 | },
14 | children: [
15 | {
16 | path: '',
17 | data: {
18 | breadcrumb: null
19 | },
20 | component: AfricanCountriesComponent,
21 | },
22 | {
23 | path: 'egypt',
24 | data: {
25 | breadcrumb: 'Egypt'
26 | },
27 | children: [
28 | {
29 | path: '',
30 | data: {
31 | breadcrumb: null
32 | },
33 | component: EgyptComponent,
34 | },
35 | {
36 | path: 'cairo',
37 | data: {
38 | breadcrumb: 'Cairo'
39 | },
40 | component: CairoComponent,
41 | },
42 | {
43 | path: 'giza',
44 | data: {
45 | breadcrumb: 'Giza'
46 | },
47 | component: GizaComponent,
48 | },
49 | ],
50 | },
51 | ]
52 | }
53 | ];
54 |
55 |
56 | @NgModule({
57 | imports: [RouterModule.forChild(routes)],
58 | exports: [RouterModule]
59 | })
60 | export class AfricaRoutingModule {
61 | }
62 |
63 |
--------------------------------------------------------------------------------
/src/app/europe/europe-routing.module.ts:
--------------------------------------------------------------------------------
1 | import {NgModule} from '@angular/core';
2 | import {RouterModule, Routes} from '@angular/router';
3 | import {EuropeanCountriesComponent} from './european-countries/european-countries.component';
4 | import {GermanyComponent} from './germany/germany.component';
5 | import {BerlinComponent} from './germany/berlin/berlin.component';
6 | import {HamburgComponent} from './germany/hambrug/hamburg.component';
7 |
8 | const routes: Routes = [
9 | {
10 | path: '',
11 | data: {
12 | breadcrumb: 'Europe'
13 | },
14 | children: [
15 | {
16 | path: '',
17 | data: {
18 | breadcrumb: null
19 | },
20 | component: EuropeanCountriesComponent,
21 | },
22 | {
23 | path: 'germany',
24 | data: {
25 | breadcrumb: 'Germany'
26 | },
27 | children: [
28 | {
29 | path: '',
30 | data: {
31 | breadcrumb: null
32 | },
33 | component: GermanyComponent,
34 | },
35 | {
36 | path: 'berlin',
37 | data: {
38 | breadcrumb: 'Berlin'
39 | },
40 | component: BerlinComponent,
41 | },
42 | {
43 | path: 'hamburg',
44 | data: {
45 | breadcrumb: 'Hamburg'
46 | },
47 | component: HamburgComponent,
48 | },
49 | ],
50 | },
51 | ]
52 | }
53 | ];
54 |
55 |
56 | @NgModule({
57 | imports: [RouterModule.forChild(routes)],
58 | exports: [RouterModule]
59 | })
60 | export class EuropeRoutingModule {
61 | }
62 |
63 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "demo-angular-breadcrumb",
3 | "version": "0.0.0",
4 | "scripts": {
5 | "ng": "ng",
6 | "start": "ng serve",
7 | "build": "ng build",
8 | "test": "ng test",
9 | "lint": "ng lint",
10 | "e2e": "ng e2e",
11 | "deploy": "ng build --prod --base-href 'https://piotrkorlaga.github.io/demo-angular-breadcrumb/' && ngh"
12 | },
13 | "private": true,
14 | "dependencies": {
15 | "@angular/animations": "~7.2.0",
16 | "@angular/cdk": "^7.3.7",
17 | "@angular/common": "~7.2.0",
18 | "@angular/compiler": "~7.2.0",
19 | "@angular/core": "~7.2.0",
20 | "@angular/forms": "~7.2.0",
21 | "@angular/platform-browser": "~7.2.0",
22 | "@angular/platform-browser-dynamic": "~7.2.0",
23 | "@angular/router": "~7.2.0",
24 | "core-js": "^2.5.4",
25 | "primeicons": "^1.0.0",
26 | "primeng": "^7.1.3",
27 | "rxjs": "~6.3.3",
28 | "tslib": "^1.9.0",
29 | "zone.js": "~0.8.26"
30 | },
31 | "devDependencies": {
32 | "@angular-devkit/build-angular": "^0.13.8",
33 | "@angular/cli": "~7.3.2",
34 | "@angular/compiler-cli": "^7.2.14",
35 | "@angular/language-service": "~7.2.0",
36 | "@types/jasmine": "~2.8.8",
37 | "@types/jasminewd2": "~2.0.3",
38 | "@types/node": "~8.9.4",
39 | "codelyzer": "~4.5.0",
40 | "jasmine-core": "~2.99.1",
41 | "jasmine-spec-reporter": "~4.2.1",
42 | "karma": "~3.1.1",
43 | "karma-chrome-launcher": "~2.2.0",
44 | "karma-coverage-istanbul-reporter": "~2.0.1",
45 | "karma-jasmine": "~1.1.2",
46 | "karma-jasmine-html-reporter": "^0.2.2",
47 | "protractor": "~5.4.0",
48 | "ts-node": "~7.0.0",
49 | "tslint": "~5.11.0",
50 | "typescript": "~3.2.2"
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/src/app/breadcrumb/breadcrumb.component.ts:
--------------------------------------------------------------------------------
1 | import {Component, OnInit} from '@angular/core';
2 | import {MenuItem} from 'primeng/api';
3 | import {isNullOrUndefined} from 'util';
4 | import {ActivatedRoute, NavigationEnd, Router, RouterEvent} from '@angular/router';
5 | import {filter} from 'rxjs/operators';
6 |
7 | @Component({
8 | selector: 'app-breadcrumb',
9 | templateUrl: './breadcrumb.component.html',
10 | styleUrls: ['./breadcrumb.component.scss']
11 | })
12 | export class BreadcrumbComponent implements OnInit {
13 | static readonly ROUTE_DATA_BREADCRUMB = 'breadcrumb';
14 | readonly home = {icon: 'pi pi-home', url: 'home'};
15 | menuItems: MenuItem[];
16 |
17 | constructor(private router: Router, private activatedRoute: ActivatedRoute) {}
18 |
19 | ngOnInit(): void {
20 | this.router.events
21 | .pipe(filter(event => event instanceof NavigationEnd))
22 | .subscribe(() => this.menuItems = this.createBreadcrumbs(this.activatedRoute.root));
23 | }
24 |
25 | private createBreadcrumbs(route: ActivatedRoute, url: string = '#', breadcrumbs: MenuItem[] = []): MenuItem[] {
26 | const children: ActivatedRoute[] = route.children;
27 |
28 | if (children.length === 0) {
29 | return breadcrumbs;
30 | }
31 |
32 | for (const child of children) {
33 | const routeURL: string = child.snapshot.url.map(segment => segment.path).join('/');
34 | if (routeURL !== '') {
35 | url += `/${routeURL}`;
36 | }
37 |
38 | const label = child.snapshot.data[BreadcrumbComponent.ROUTE_DATA_BREADCRUMB];
39 | if (!isNullOrUndefined(label)) {
40 | breadcrumbs.push({label, url});
41 | }
42 |
43 | return this.createBreadcrumbs(child, url, breadcrumbs);
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "tslint:recommended",
3 | "rulesDirectory": [
4 | "codelyzer"
5 | ],
6 | "rules": {
7 | "array-type": false,
8 | "arrow-parens": false,
9 | "deprecation": {
10 | "severity": "warn"
11 | },
12 | "import-blacklist": [
13 | true,
14 | "rxjs/Rx"
15 | ],
16 | "interface-name": false,
17 | "max-classes-per-file": false,
18 | "max-line-length": [
19 | true,
20 | 140
21 | ],
22 | "member-access": false,
23 | "member-ordering": [
24 | true,
25 | {
26 | "order": [
27 | "static-field",
28 | "instance-field",
29 | "static-method",
30 | "instance-method"
31 | ]
32 | }
33 | ],
34 | "no-consecutive-blank-lines": false,
35 | "no-console": [
36 | true,
37 | "debug",
38 | "info",
39 | "time",
40 | "timeEnd",
41 | "trace"
42 | ],
43 | "no-empty": false,
44 | "no-inferrable-types": [
45 | true,
46 | "ignore-params"
47 | ],
48 | "no-non-null-assertion": true,
49 | "no-redundant-jsdoc": true,
50 | "no-switch-case-fall-through": true,
51 | "no-use-before-declare": true,
52 | "no-var-requires": false,
53 | "object-literal-key-quotes": [
54 | true,
55 | "as-needed"
56 | ],
57 | "object-literal-sort-keys": false,
58 | "ordered-imports": false,
59 | "quotemark": [
60 | true,
61 | "single"
62 | ],
63 | "trailing-comma": false,
64 | "no-output-on-prefix": true,
65 | "use-input-property-decorator": true,
66 | "use-output-property-decorator": true,
67 | "use-host-property-decorator": true,
68 | "no-input-rename": true,
69 | "no-output-rename": true,
70 | "use-life-cycle-interface": true,
71 | "use-pipe-transform-interface": true,
72 | "component-class-suffix": true,
73 | "directive-class-suffix": true
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/src/polyfills.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * This file includes polyfills needed by Angular and is loaded before the app.
3 | * You can add your own extra polyfills to this file.
4 | *
5 | * This file is divided into 2 sections:
6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main
8 | * file.
9 | *
10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
13 | *
14 | * Learn more in https://angular.io/guide/browser-support
15 | */
16 |
17 | /***************************************************************************************************
18 | * BROWSER POLYFILLS
19 | */
20 |
21 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */
22 | // import 'classlist.js'; // Run `npm install --save classlist.js`.
23 |
24 | /**
25 | * Web Animations `@angular/platform-browser/animations`
26 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
27 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
28 | */
29 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`.
30 |
31 | /**
32 | * By default, zone.js will patch all possible macroTask and DomEvents
33 | * user can disable parts of macroTask/DomEvents patch by setting following flags
34 | * because those flags need to be set before `zone.js` being loaded, and webpack
35 | * will put import in the top of bundle, so user need to create a separate file
36 | * in this directory (for example: zone-flags.ts), and put the following flags
37 | * into that file, and then add the following code before importing zone.js.
38 | * import './zone-flags.ts';
39 | *
40 | * The flags allowed in zone-flags.ts are listed here.
41 | *
42 | * The following flags will work for all browsers.
43 | *
44 | * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
45 | * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
46 | * (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
47 | *
48 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
49 | * with the following flag, it will bypass `zone.js` patch for IE/Edge
50 | *
51 | * (window as any).__Zone_enable_cross_context_check = true;
52 | *
53 | */
54 |
55 | /***************************************************************************************************
56 | * Zone JS is required by default for Angular itself.
57 | */
58 | import 'zone.js/dist/zone'; // Included with Angular CLI.
59 |
60 |
61 | /***************************************************************************************************
62 | * APPLICATION IMPORTS
63 | */
64 |
--------------------------------------------------------------------------------
/angular.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3 | "version": 1,
4 | "newProjectRoot": "projects",
5 | "projects": {
6 | "demo-angular-breadcrumb": {
7 | "root": "",
8 | "sourceRoot": "src",
9 | "projectType": "application",
10 | "prefix": "app",
11 | "schematics": {
12 | "@schematics/angular:component": {
13 | "style": "sass"
14 | }
15 | },
16 | "architect": {
17 | "build": {
18 | "builder": "@angular-devkit/build-angular:browser",
19 | "options": {
20 | "outputPath": "dist",
21 | "index": "src/index.html",
22 | "main": "src/main.ts",
23 | "polyfills": "src/polyfills.ts",
24 | "tsConfig": "src/tsconfig.app.json",
25 | "assets": [
26 | "src/favicon.ico",
27 | "src/assets"
28 | ],
29 | "styles": [
30 | "node_modules/primeng/resources/themes/nova-light/theme.css",
31 | "node_modules/primeng/resources/primeng.min.css",
32 | "node_modules/primeicons/primeicons.css",
33 | "src/styles.scss"
34 | ],
35 | "scripts": [],
36 | "es5BrowserSupport": true
37 | },
38 | "configurations": {
39 | "production": {
40 | "fileReplacements": [
41 | {
42 | "replace": "src/environments/environment.ts",
43 | "with": "src/environments/environment.prod.ts"
44 | }
45 | ],
46 | "optimization": true,
47 | "outputHashing": "all",
48 | "sourceMap": false,
49 | "extractCss": true,
50 | "namedChunks": false,
51 | "aot": true,
52 | "extractLicenses": true,
53 | "vendorChunk": false,
54 | "buildOptimizer": true,
55 | "budgets": [
56 | {
57 | "type": "initial",
58 | "maximumWarning": "2mb",
59 | "maximumError": "5mb"
60 | }
61 | ]
62 | }
63 | }
64 | },
65 | "serve": {
66 | "builder": "@angular-devkit/build-angular:dev-server",
67 | "options": {
68 | "browserTarget": "demo-angular-breadcrumb:build"
69 | },
70 | "configurations": {
71 | "production": {
72 | "browserTarget": "demo-angular-breadcrumb:build:production"
73 | }
74 | }
75 | },
76 | "extract-i18n": {
77 | "builder": "@angular-devkit/build-angular:extract-i18n",
78 | "options": {
79 | "browserTarget": "demo-angular-breadcrumb:build"
80 | }
81 | },
82 | "test": {
83 | "builder": "@angular-devkit/build-angular:karma",
84 | "options": {
85 | "main": "src/test.ts",
86 | "polyfills": "src/polyfills.ts",
87 | "tsConfig": "src/tsconfig.spec.json",
88 | "karmaConfig": "src/karma.conf.js",
89 | "styles": [
90 | "src/styles.scss"
91 | ],
92 | "scripts": [],
93 | "assets": [
94 | "src/favicon.ico",
95 | "src/assets"
96 | ]
97 | }
98 | },
99 | "lint": {
100 | "builder": "@angular-devkit/build-angular:tslint",
101 | "options": {
102 | "tsConfig": [
103 | "src/tsconfig.app.json",
104 | "src/tsconfig.spec.json"
105 | ],
106 | "exclude": [
107 | "**/node_modules/**"
108 | ]
109 | }
110 | }
111 | }
112 | },
113 | "demo-angular-breadcrumb-e2e": {
114 | "root": "e2e/",
115 | "projectType": "application",
116 | "prefix": "",
117 | "architect": {
118 | "e2e": {
119 | "builder": "@angular-devkit/build-angular:protractor",
120 | "options": {
121 | "protractorConfig": "e2e/protractor.conf.js",
122 | "devServerTarget": "demo-angular-breadcrumb:serve"
123 | },
124 | "configurations": {
125 | "production": {
126 | "devServerTarget": "demo-angular-breadcrumb:serve:production"
127 | }
128 | }
129 | },
130 | "lint": {
131 | "builder": "@angular-devkit/build-angular:tslint",
132 | "options": {
133 | "tsConfig": "e2e/tsconfig.e2e.json",
134 | "exclude": [
135 | "**/node_modules/**"
136 | ]
137 | }
138 | }
139 | }
140 | }
141 | },
142 | "defaultProject": "demo-angular-breadcrumb"
143 | }
144 |
--------------------------------------------------------------------------------