├── .editorconfig ├── .gitignore ├── LICENSE ├── README.md ├── angular.json ├── e2e ├── protractor.conf.js ├── src │ ├── app.e2e-spec.ts │ └── app.po.ts └── tsconfig.e2e.json ├── package-lock.json ├── package.json ├── readme-images ├── dashboard.png ├── dashboard_with_custom_sidenav.png ├── landing_page.png └── logo_250x60.png ├── src ├── .browserslistrc ├── app │ ├── app-routing.module.spec.ts │ ├── app-routing.module.ts │ ├── app.component.html │ ├── app.component.scss │ ├── app.component.spec.ts │ ├── app.component.ts │ ├── app.module.ts │ ├── layout │ │ ├── authorised │ │ │ ├── authorised-layout │ │ │ │ ├── authorised-layout.component.html │ │ │ │ ├── authorised-layout.component.scss │ │ │ │ ├── authorised-layout.component.spec.ts │ │ │ │ └── authorised-layout.component.ts │ │ │ ├── authorised-side-nav-toggler │ │ │ │ ├── authorised-side-nav-toggler.component.html │ │ │ │ ├── authorised-side-nav-toggler.component.scss │ │ │ │ ├── authorised-side-nav-toggler.component.spec.ts │ │ │ │ └── authorised-side-nav-toggler.component.ts │ │ │ ├── authorised-side-nav │ │ │ │ ├── authorised-side-nav.component.html │ │ │ │ ├── authorised-side-nav.component.scss │ │ │ │ ├── authorised-side-nav.component.spec.ts │ │ │ │ └── authorised-side-nav.component.ts │ │ │ ├── authorised-top-nav │ │ │ │ ├── authorised-top-nav.component.html │ │ │ │ ├── authorised-top-nav.component.scss │ │ │ │ ├── authorised-top-nav.component.spec.ts │ │ │ │ └── authorised-top-nav.component.ts │ │ │ └── services │ │ │ │ ├── authorised-side-nav.service.spec.ts │ │ │ │ └── authorised-side-nav.service.ts │ │ ├── guest │ │ │ ├── guest-footer │ │ │ │ ├── guest-footer.component.html │ │ │ │ ├── guest-footer.component.scss │ │ │ │ ├── guest-footer.component.spec.ts │ │ │ │ └── guest-footer.component.ts │ │ │ ├── guest-layout │ │ │ │ ├── guest-layout.component.html │ │ │ │ ├── guest-layout.component.scss │ │ │ │ ├── guest-layout.component.spec.ts │ │ │ │ └── guest-layout.component.ts │ │ │ └── guest-top-nav │ │ │ │ ├── guest-top-nav.component.html │ │ │ │ ├── guest-top-nav.component.scss │ │ │ │ ├── guest-top-nav.component.spec.ts │ │ │ │ └── guest-top-nav.component.ts │ │ └── page-content │ │ │ ├── page-content.component.html │ │ │ ├── page-content.component.scss │ │ │ ├── page-content.component.spec.ts │ │ │ └── page-content.component.ts │ └── pages │ │ ├── dashboard │ │ ├── dashboard.component.html │ │ ├── dashboard.component.scss │ │ ├── dashboard.component.spec.ts │ │ └── dashboard.component.ts │ │ └── landing-page │ │ ├── landing-page.component.html │ │ ├── landing-page.component.scss │ │ ├── landing-page.component.spec.ts │ │ └── landing-page.component.ts ├── assets │ └── .gitkeep ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── favicon.ico ├── index.html ├── karma.conf.js ├── main.ts ├── polyfills.ts ├── styles.scss ├── test.ts ├── tsconfig.app.json ├── tsconfig.spec.json └── tslint.json ├── tsconfig.base.json ├── tsconfig.json └── tslint.json /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://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 | -------------------------------------------------------------------------------- /.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 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | *.iml 20 | 21 | # IDE - VSCode 22 | .vscode/* 23 | !.vscode/settings.json 24 | !.vscode/tasks.json 25 | !.vscode/launch.json 26 | !.vscode/extensions.json 27 | 28 | # misc 29 | /.sass-cache 30 | /connect.lock 31 | /coverage 32 | /libpeerconnection.log 33 | npm-debug.log 34 | yarn-error.log 35 | testem.log 36 | /typings 37 | 38 | # System Files 39 | .DS_Store 40 | Thumbs.db 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # angular-multi-layout-scaffolding 2 | 3 | ![keep growing logo](readme-images/logo_250x60.png) 4 | 5 | To learn how to set up a project like this one, check out the [Apply multi-layout to an Angular app](http://keepgrowing.in/angular/apply-multi-layout-to-an-angular-app/) post. 6 | 7 | This application serves two separate layouts - one provided on a landing page view, the other used on a dashboard view. There is a horizontal navigation and a footer on the landing page and a vertical navigation on a dashboard. 8 | 9 | All views are complemented with Bootstrap classes. 10 | 11 | ![landing page screenshot](readme-images/landing_page.png "Landing page") 12 | ![dashboard page screenshot](readme-images/dashboard_with_custom_sidenav.png "Dashboard page") 13 | 14 | ## Getting Started 15 | 16 | To clone the repository, run in the command line: 17 | ```bash 18 | $ git clone https://github.com/little-pinecone/angular-multi-layout-scaffolding.git 19 | ``` 20 | 21 | ## Development server 22 | 23 | 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. 24 | 25 | ## Build 26 | 27 | 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. 28 | 29 | ## Running unit tests 30 | 31 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). 32 | 33 | ## Built With 34 | 35 | * [Angular 6](https://angular.io/) updated to [Angular 10](https://github.com/angular/angular/releases/tag/10.0.3) 36 | * [Bootstrap 4](https://getbootstrap.com/) 37 | 38 | ## License 39 | 40 | This project is licensed under the Unlicense - see the [license details](https://choosealicense.com/licenses/unlicense/). 41 | -------------------------------------------------------------------------------- /angular.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "projects": { 6 | "angular-multi-layout-scaffolding": { 7 | "root": "", 8 | "sourceRoot": "src", 9 | "projectType": "application", 10 | "prefix": "app", 11 | "schematics": { 12 | "@schematics/angular:component": { 13 | "style": "scss" 14 | } 15 | }, 16 | "architect": { 17 | "build": { 18 | "builder": "@angular-devkit/build-angular:browser", 19 | "options": { 20 | "aot": true, 21 | "outputPath": "dist/angular-multi-layout-scaffolding", 22 | "index": "src/index.html", 23 | "main": "src/main.ts", 24 | "polyfills": "src/polyfills.ts", 25 | "tsConfig": "src/tsconfig.app.json", 26 | "assets": [ 27 | "src/favicon.ico", 28 | "src/assets" 29 | ], 30 | "styles": [ 31 | "src/styles.scss", 32 | "node_modules/bootstrap/scss/bootstrap.scss" 33 | ], 34 | "scripts": [] 35 | }, 36 | "configurations": { 37 | "production": { 38 | "budgets": [ 39 | { 40 | "type": "anyComponentStyle", 41 | "maximumWarning": "6kb" 42 | } 43 | ], 44 | "fileReplacements": [ 45 | { 46 | "replace": "src/environments/environment.ts", 47 | "with": "src/environments/environment.prod.ts" 48 | } 49 | ], 50 | "optimization": true, 51 | "outputHashing": "all", 52 | "sourceMap": false, 53 | "extractCss": true, 54 | "namedChunks": false, 55 | "aot": true, 56 | "extractLicenses": true, 57 | "vendorChunk": false, 58 | "buildOptimizer": true 59 | } 60 | } 61 | }, 62 | "serve": { 63 | "builder": "@angular-devkit/build-angular:dev-server", 64 | "options": { 65 | "browserTarget": "angular-multi-layout-scaffolding:build" 66 | }, 67 | "configurations": { 68 | "production": { 69 | "browserTarget": "angular-multi-layout-scaffolding:build:production" 70 | } 71 | } 72 | }, 73 | "extract-i18n": { 74 | "builder": "@angular-devkit/build-angular:extract-i18n", 75 | "options": { 76 | "browserTarget": "angular-multi-layout-scaffolding:build" 77 | } 78 | }, 79 | "test": { 80 | "builder": "@angular-devkit/build-angular:karma", 81 | "options": { 82 | "main": "src/test.ts", 83 | "polyfills": "src/polyfills.ts", 84 | "tsConfig": "src/tsconfig.spec.json", 85 | "karmaConfig": "src/karma.conf.js", 86 | "styles": [ 87 | "src/styles.scss" 88 | ], 89 | "scripts": [], 90 | "assets": [ 91 | "src/favicon.ico", 92 | "src/assets" 93 | ] 94 | } 95 | }, 96 | "lint": { 97 | "builder": "@angular-devkit/build-angular:tslint", 98 | "options": { 99 | "tsConfig": [ 100 | "src/tsconfig.app.json", 101 | "src/tsconfig.spec.json" 102 | ], 103 | "exclude": [ 104 | "**/node_modules/**" 105 | ] 106 | } 107 | } 108 | } 109 | }, 110 | "angular-multi-layout-scaffolding-e2e": { 111 | "root": "e2e/", 112 | "projectType": "application", 113 | "architect": { 114 | "e2e": { 115 | "builder": "@angular-devkit/build-angular:protractor", 116 | "options": { 117 | "protractorConfig": "e2e/protractor.conf.js", 118 | "devServerTarget": "angular-multi-layout-scaffolding:serve" 119 | }, 120 | "configurations": { 121 | "production": { 122 | "devServerTarget": "angular-multi-layout-scaffolding:serve:production" 123 | } 124 | } 125 | }, 126 | "lint": { 127 | "builder": "@angular-devkit/build-angular:tslint", 128 | "options": { 129 | "tsConfig": "e2e/tsconfig.e2e.json", 130 | "exclude": [ 131 | "**/node_modules/**" 132 | ] 133 | } 134 | } 135 | } 136 | } 137 | }, 138 | "defaultProject": "angular-multi-layout-scaffolding" 139 | } 140 | -------------------------------------------------------------------------------- /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 | }; -------------------------------------------------------------------------------- /e2e/src/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('workspace-project App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to angular-multi-layout-scaffolding!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.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 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-multi-layout-scaffolding", 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 | }, 12 | "private": true, 13 | "dependencies": { 14 | "@angular/animations": "^10.0.4", 15 | "@angular/common": "^10.0.4", 16 | "@angular/compiler": "^10.0.4", 17 | "@angular/core": "^10.0.4", 18 | "@angular/forms": "^10.0.4", 19 | "@angular/platform-browser": "^10.0.4", 20 | "@angular/platform-browser-dynamic": "^10.0.4", 21 | "@angular/router": "^10.0.4", 22 | "bootstrap": "^4.3.1", 23 | "core-js": "^2.5.4", 24 | "jquery": "^3.5.1", 25 | "popper.js": "^1.15.0", 26 | "rxjs": "^6.5.4", 27 | "tslib": "^2.0.0", 28 | "zone.js": "~0.10.2" 29 | }, 30 | "devDependencies": { 31 | "@angular-devkit/build-angular": "~0.1000.3", 32 | "@angular/cli": "~10.0.3", 33 | "@angular/compiler-cli": "^10.0.4", 34 | "@angular/language-service": "^10.0.4", 35 | "@types/jasmine": "~2.8.6", 36 | "@types/jasminewd2": "~2.0.3", 37 | "@types/node": "^12.11.1", 38 | "codelyzer": "^6.0.0", 39 | "jasmine-core": "~3.5.0", 40 | "jasmine-spec-reporter": "~5.0.0", 41 | "karma": "~5.0.0", 42 | "karma-chrome-launcher": "~3.1.0", 43 | "karma-coverage-istanbul-reporter": "~3.0.2", 44 | "karma-jasmine": "~3.3.0", 45 | "karma-jasmine-html-reporter": "^1.5.0", 46 | "protractor": "~7.0.0", 47 | "ts-node": "~5.0.1", 48 | "tslint": "~6.1.0", 49 | "typescript": "3.9.7" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /readme-images/dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/little-pinecone/angular-multi-layout-scaffolding/671e15c9c5272112b80251583a1ef4b74a040555/readme-images/dashboard.png -------------------------------------------------------------------------------- /readme-images/dashboard_with_custom_sidenav.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/little-pinecone/angular-multi-layout-scaffolding/671e15c9c5272112b80251583a1ef4b74a040555/readme-images/dashboard_with_custom_sidenav.png -------------------------------------------------------------------------------- /readme-images/landing_page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/little-pinecone/angular-multi-layout-scaffolding/671e15c9c5272112b80251583a1ef4b74a040555/readme-images/landing_page.png -------------------------------------------------------------------------------- /readme-images/logo_250x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/little-pinecone/angular-multi-layout-scaffolding/671e15c9c5272112b80251583a1ef4b74a040555/readme-images/logo_250x60.png -------------------------------------------------------------------------------- /src/.browserslistrc: -------------------------------------------------------------------------------- 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 | # For IE 9-11 support, please uncomment the last line of the file and adjust as needed 5 | > 0.5% 6 | last 2 versions 7 | Firefox ESR 8 | not dead 9 | # IE 9-11 -------------------------------------------------------------------------------- /src/app/app-routing.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { AppRoutingModule } from './app-routing.module'; 2 | 3 | describe('AppRoutingModule', () => { 4 | let appRoutingModule: AppRoutingModule; 5 | 6 | beforeEach(() => { 7 | appRoutingModule = new AppRoutingModule(); 8 | }); 9 | 10 | it('should create an instance', () => { 11 | expect(appRoutingModule).toBeTruthy(); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes} from '@angular/router'; 3 | 4 | import { GuestLayoutComponent } from './layout/guest/guest-layout/guest-layout.component'; 5 | import { LandingPageComponent } from './pages/landing-page/landing-page.component'; 6 | import { AuthorisedLayoutComponent } from './layout/authorised/authorised-layout/authorised-layout.component'; 7 | import { DashboardComponent } from './pages/dashboard/dashboard.component'; 8 | 9 | const routes: Routes = [ 10 | { 11 | path: '', 12 | component: GuestLayoutComponent, 13 | children: [ 14 | { path: '', component: LandingPageComponent, pathMatch: 'full'}, 15 | ] 16 | }, 17 | { 18 | path: '', 19 | component: AuthorisedLayoutComponent, 20 | children: [ 21 | { path: 'dashboard', component: DashboardComponent }, 22 | ] 23 | }, 24 | ]; 25 | 26 | @NgModule({ 27 | imports: [RouterModule.forRoot(routes)], 28 | exports: [ RouterModule ] 29 | }) 30 | export class AppRoutingModule { } 31 | -------------------------------------------------------------------------------- /src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/app/app.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/little-pinecone/angular-multi-layout-scaffolding/671e15c9c5272112b80251583a1ef4b74a040555/src/app/app.component.scss -------------------------------------------------------------------------------- /src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | import { RouterTestingModule } from '@angular/router/testing'; 4 | describe('AppComponent', () => { 5 | beforeEach(async(() => { 6 | TestBed.configureTestingModule({ 7 | declarations: [ 8 | AppComponent 9 | ], 10 | imports: [ RouterTestingModule ], 11 | }).compileComponents(); 12 | })); 13 | it('should create the app', async(() => { 14 | const fixture = TestBed.createComponent(AppComponent); 15 | const app = fixture.debugElement.componentInstance; 16 | expect(app).toBeTruthy(); 17 | })); 18 | }); 19 | -------------------------------------------------------------------------------- /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 = 'app'; 10 | } 11 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | import { AppComponent } from './app.component'; 5 | import { PageContentComponent } from './layout/page-content/page-content.component'; 6 | import { GuestTopNavComponent } from './layout/guest/guest-top-nav/guest-top-nav.component'; 7 | import { GuestFooterComponent } from './layout/guest/guest-footer/guest-footer.component'; 8 | import { GuestLayoutComponent } from './layout/guest/guest-layout/guest-layout.component'; 9 | import { LandingPageComponent } from './pages/landing-page/landing-page.component'; 10 | import { AppRoutingModule } from './/app-routing.module'; 11 | import { AuthorisedSideNavComponent } from './layout/authorised/authorised-side-nav/authorised-side-nav.component'; 12 | import { AuthorisedLayoutComponent } from './layout/authorised/authorised-layout/authorised-layout.component'; 13 | import { DashboardComponent } from './pages/dashboard/dashboard.component'; 14 | import { AuthorisedTopNavComponent } from './layout/authorised/authorised-top-nav/authorised-top-nav.component'; 15 | import { AuthorisedSideNavTogglerComponent } from './layout/authorised/authorised-side-nav-toggler/authorised-side-nav-toggler.component'; 16 | 17 | @NgModule({ 18 | declarations: [ 19 | AppComponent, 20 | PageContentComponent, 21 | GuestTopNavComponent, 22 | GuestFooterComponent, 23 | GuestLayoutComponent, 24 | LandingPageComponent, 25 | AuthorisedSideNavComponent, 26 | AuthorisedLayoutComponent, 27 | DashboardComponent, 28 | AuthorisedTopNavComponent, 29 | AuthorisedSideNavTogglerComponent 30 | ], 31 | imports: [ 32 | BrowserModule, 33 | AppRoutingModule 34 | ], 35 | providers: [], 36 | bootstrap: [AppComponent] 37 | }) 38 | export class AppModule { } 39 | -------------------------------------------------------------------------------- /src/app/layout/authorised/authorised-layout/authorised-layout.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 |
6 | -------------------------------------------------------------------------------- /src/app/layout/authorised/authorised-layout/authorised-layout.component.scss: -------------------------------------------------------------------------------- 1 | .wrapper { 2 | display: flex; 3 | flex-direction: row; 4 | } 5 | -------------------------------------------------------------------------------- /src/app/layout/authorised/authorised-layout/authorised-layout.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AuthorisedLayoutComponent } from './authorised-layout.component'; 4 | 5 | import { Component } from '@angular/core'; 6 | 7 | @Component({selector: 'app-authorised-side-nav', template: ''}) 8 | class AuthorisedSideNavComponent {} 9 | 10 | @Component({selector: 'app-authorised-top-nav', template: ''}) 11 | class AuthorisedTopNavComponent {} 12 | 13 | @Component({selector: 'app-page-content', template: ''}) 14 | class PageContentComponent { } 15 | 16 | describe('AuthorisedLayoutComponent', () => { 17 | let component: AuthorisedLayoutComponent; 18 | let fixture: ComponentFixture; 19 | 20 | beforeEach(async(() => { 21 | TestBed.configureTestingModule({ 22 | declarations: [ 23 | AuthorisedLayoutComponent, 24 | AuthorisedSideNavComponent, 25 | AuthorisedTopNavComponent, 26 | PageContentComponent 27 | ] 28 | }) 29 | .compileComponents(); 30 | })); 31 | 32 | beforeEach(() => { 33 | fixture = TestBed.createComponent(AuthorisedLayoutComponent); 34 | component = fixture.componentInstance; 35 | fixture.detectChanges(); 36 | }); 37 | 38 | it('should create', () => { 39 | expect(component).toBeTruthy(); 40 | }); 41 | }); 42 | -------------------------------------------------------------------------------- /src/app/layout/authorised/authorised-layout/authorised-layout.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-authorised-layout', 5 | templateUrl: './authorised-layout.component.html', 6 | styleUrls: ['./authorised-layout.component.scss'] 7 | }) 8 | export class AuthorisedLayoutComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/layout/authorised/authorised-side-nav-toggler/authorised-side-nav-toggler.component.html: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /src/app/layout/authorised/authorised-side-nav-toggler/authorised-side-nav-toggler.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/little-pinecone/angular-multi-layout-scaffolding/671e15c9c5272112b80251583a1ef4b74a040555/src/app/layout/authorised/authorised-side-nav-toggler/authorised-side-nav-toggler.component.scss -------------------------------------------------------------------------------- /src/app/layout/authorised/authorised-side-nav-toggler/authorised-side-nav-toggler.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AuthorisedSideNavTogglerComponent } from './authorised-side-nav-toggler.component'; 4 | 5 | describe('AuthorisedSideNavTogglerComponent', () => { 6 | let component: AuthorisedSideNavTogglerComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ AuthorisedSideNavTogglerComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(AuthorisedSideNavTogglerComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/layout/authorised/authorised-side-nav-toggler/authorised-side-nav-toggler.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | import { AuthorisedSideNavService } from '../services/authorised-side-nav.service'; 4 | 5 | @Component({ 6 | selector: 'app-authorised-side-nav-toggler', 7 | templateUrl: './authorised-side-nav-toggler.component.html', 8 | styleUrls: ['./authorised-side-nav-toggler.component.scss'] 9 | }) 10 | export class AuthorisedSideNavTogglerComponent implements OnInit { 11 | 12 | constructor(public sideNavService: AuthorisedSideNavService) { } 13 | 14 | ngOnInit() { 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/app/layout/authorised/authorised-side-nav/authorised-side-nav.component.html: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /src/app/layout/authorised/authorised-side-nav/authorised-side-nav.component.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | background: #343a40; 3 | } 4 | 5 | #sidebar { 6 | min-width: 200px; 7 | max-width: 200px; 8 | min-height: 100vh; 9 | color: #fff; 10 | transition: all 0.3s; 11 | font-weight: 300; 12 | font-size: 1rem; 13 | line-height: 1.5; 14 | } 15 | 16 | #sidebar.hidden { 17 | margin-left: -200px; 18 | } 19 | 20 | a[data-toggle="collapse"] { 21 | position: relative; 22 | } 23 | 24 | @media (max-width: 575px) { 25 | #sidebar { 26 | margin-left: -200px; 27 | } 28 | #sidebar.hidden { 29 | margin-left: 0; 30 | } 31 | } 32 | 33 | a, a:hover, a:focus { 34 | color: inherit; 35 | } 36 | 37 | #sidebar .sidebar-header { 38 | padding: 20px; 39 | } 40 | 41 | #sidebar ul li a { 42 | padding: 15px; 43 | display: block; 44 | width: 100%; 45 | &:hover { 46 | background-color: rgba(255, 255, 255, 0.1); 47 | } 48 | } 49 | 50 | hr { 51 | border-top: 1px solid #fff; 52 | margin-top: 0; 53 | } 54 | -------------------------------------------------------------------------------- /src/app/layout/authorised/authorised-side-nav/authorised-side-nav.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AuthorisedSideNavComponent } from './authorised-side-nav.component'; 4 | 5 | describe('AuthorisedSideNavComponent', () => { 6 | let component: AuthorisedSideNavComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ AuthorisedSideNavComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(AuthorisedSideNavComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | it('should render menu in the top navigation', async(() => { 26 | const compiled = fixture.debugElement.nativeElement; 27 | expect(compiled.querySelector('nav').textContent).toContain('LinkLink'); 28 | })); 29 | }); 30 | -------------------------------------------------------------------------------- /src/app/layout/authorised/authorised-side-nav/authorised-side-nav.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { AuthorisedSideNavService } from '../services/authorised-side-nav.service'; 3 | 4 | @Component({ 5 | selector: 'app-authorised-side-nav', 6 | templateUrl: './authorised-side-nav.component.html', 7 | styleUrls: ['./authorised-side-nav.component.scss'] 8 | }) 9 | export class AuthorisedSideNavComponent implements OnInit { 10 | 11 | constructor(public sideNavService: AuthorisedSideNavService) { } 12 | 13 | ngOnInit() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/app/layout/authorised/authorised-top-nav/authorised-top-nav.component.html: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /src/app/layout/authorised/authorised-top-nav/authorised-top-nav.component.scss: -------------------------------------------------------------------------------- 1 | h3 { 2 | color: orange; 3 | } 4 | -------------------------------------------------------------------------------- /src/app/layout/authorised/authorised-top-nav/authorised-top-nav.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AuthorisedTopNavComponent } from './authorised-top-nav.component'; 4 | import { Component } from '@angular/core'; 5 | 6 | @Component({selector: 'app-authorised-side-nav-toggler', template: ''}) 7 | class AuthorisedSideNavTogglerComponent {} 8 | 9 | describe('AuthorisedTopNavComponent', () => { 10 | let component: AuthorisedTopNavComponent; 11 | let fixture: ComponentFixture; 12 | 13 | beforeEach(async(() => { 14 | TestBed.configureTestingModule({ 15 | declarations: [ 16 | AuthorisedTopNavComponent, 17 | AuthorisedSideNavTogglerComponent 18 | ] 19 | }) 20 | .compileComponents(); 21 | })); 22 | 23 | beforeEach(() => { 24 | fixture = TestBed.createComponent(AuthorisedTopNavComponent); 25 | component = fixture.componentInstance; 26 | fixture.detectChanges(); 27 | }); 28 | 29 | it('should create', () => { 30 | expect(component).toBeTruthy(); 31 | }); 32 | }); 33 | -------------------------------------------------------------------------------- /src/app/layout/authorised/authorised-top-nav/authorised-top-nav.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-authorised-top-nav', 5 | templateUrl: './authorised-top-nav.component.html', 6 | styleUrls: ['./authorised-top-nav.component.scss'] 7 | }) 8 | export class AuthorisedTopNavComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/layout/authorised/services/authorised-side-nav.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, inject } from '@angular/core/testing'; 2 | 3 | import { AuthorisedSideNavService } from './authorised-side-nav.service'; 4 | 5 | describe('AuthorisedSideNavService', () => { 6 | beforeEach(() => { 7 | TestBed.configureTestingModule({ 8 | providers: [AuthorisedSideNavService] 9 | }); 10 | }); 11 | 12 | it('should be created', inject([AuthorisedSideNavService], (service: AuthorisedSideNavService) => { 13 | expect(service).toBeTruthy(); 14 | })); 15 | }); 16 | -------------------------------------------------------------------------------- /src/app/layout/authorised/services/authorised-side-nav.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | @Injectable({ 4 | providedIn: 'root' 5 | }) 6 | export class AuthorisedSideNavService { 7 | hideSideNav: boolean = false; 8 | 9 | constructor() { } 10 | 11 | toggleSideNav(): void { 12 | this.hideSideNav = !this.hideSideNav; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/app/layout/guest/guest-footer/guest-footer.component.html: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /src/app/layout/guest/guest-footer/guest-footer.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/little-pinecone/angular-multi-layout-scaffolding/671e15c9c5272112b80251583a1ef4b74a040555/src/app/layout/guest/guest-footer/guest-footer.component.scss -------------------------------------------------------------------------------- /src/app/layout/guest/guest-footer/guest-footer.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { GuestFooterComponent } from './guest-footer.component'; 4 | 5 | describe('GuestFooterComponent', () => { 6 | let component: GuestFooterComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ GuestFooterComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(GuestFooterComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | it('should render brand name in a footer tag', async(() => { 26 | const compiled = fixture.debugElement.nativeElement; 27 | expect(compiled.querySelector('footer').textContent).toContain('keep_growing'); 28 | })); 29 | }); 30 | -------------------------------------------------------------------------------- /src/app/layout/guest/guest-footer/guest-footer.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-guest-footer', 5 | templateUrl: './guest-footer.component.html', 6 | styleUrls: ['./guest-footer.component.scss'] 7 | }) 8 | export class GuestFooterComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/layout/guest/guest-layout/guest-layout.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 |
6 | -------------------------------------------------------------------------------- /src/app/layout/guest/guest-layout/guest-layout.component.scss: -------------------------------------------------------------------------------- 1 | .wrapper { 2 | display: flex; 3 | flex-direction: column; 4 | height: 100%; 5 | justify-content: space-between; 6 | } 7 | -------------------------------------------------------------------------------- /src/app/layout/guest/guest-layout/guest-layout.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { GuestLayoutComponent } from './guest-layout.component'; 4 | 5 | import { Component } from '@angular/core'; 6 | 7 | @Component({selector: 'app-guest-top-nav', template: ''}) 8 | class GuestTopNavComponent {} 9 | 10 | @Component({selector: 'app-page-content', template: ''}) 11 | class PageContentComponent { } 12 | 13 | @Component({selector: 'app-guest-footer', template: ''}) 14 | class GuestFooterComponent {} 15 | 16 | describe('GuestLayoutComponent', () => { 17 | let component: GuestLayoutComponent; 18 | let fixture: ComponentFixture; 19 | 20 | beforeEach(async(() => { 21 | TestBed.configureTestingModule({ 22 | declarations: [ 23 | GuestLayoutComponent, 24 | GuestTopNavComponent, 25 | PageContentComponent, 26 | GuestFooterComponent 27 | ] 28 | }) 29 | .compileComponents(); 30 | })); 31 | 32 | beforeEach(() => { 33 | fixture = TestBed.createComponent(GuestLayoutComponent); 34 | component = fixture.componentInstance; 35 | fixture.detectChanges(); 36 | }); 37 | 38 | it('should create', () => { 39 | expect(component).toBeTruthy(); 40 | }); 41 | }); 42 | -------------------------------------------------------------------------------- /src/app/layout/guest/guest-layout/guest-layout.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-guest-layout', 5 | templateUrl: './guest-layout.component.html', 6 | styleUrls: ['./guest-layout.component.scss'] 7 | }) 8 | export class GuestLayoutComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/layout/guest/guest-top-nav/guest-top-nav.component.html: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /src/app/layout/guest/guest-top-nav/guest-top-nav.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/little-pinecone/angular-multi-layout-scaffolding/671e15c9c5272112b80251583a1ef4b74a040555/src/app/layout/guest/guest-top-nav/guest-top-nav.component.scss -------------------------------------------------------------------------------- /src/app/layout/guest/guest-top-nav/guest-top-nav.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { GuestTopNavComponent } from './guest-top-nav.component'; 4 | 5 | describe('GuestTopNavComponent', () => { 6 | let component: GuestTopNavComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ GuestTopNavComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(GuestTopNavComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | it('should render menu in the top navigation', async(() => { 26 | const compiled = fixture.debugElement.nativeElement; 27 | expect(compiled.querySelector('nav').textContent).toContain('LinkDisabled'); 28 | })); 29 | }); 30 | -------------------------------------------------------------------------------- /src/app/layout/guest/guest-top-nav/guest-top-nav.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-guest-top-nav', 5 | templateUrl: './guest-top-nav.component.html', 6 | styleUrls: ['./guest-top-nav.component.scss'] 7 | }) 8 | export class GuestTopNavComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/layout/page-content/page-content.component.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/app/layout/page-content/page-content.component.scss: -------------------------------------------------------------------------------- 1 | :host { 2 | &.full-width { 3 | width: 100%; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/app/layout/page-content/page-content.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | import { RouterTestingModule } from '@angular/router/testing'; 3 | 4 | import { PageContentComponent } from './page-content.component'; 5 | 6 | describe('PageContentComponent', () => { 7 | let component: PageContentComponent; 8 | let fixture: ComponentFixture; 9 | 10 | beforeEach(async(() => { 11 | TestBed.configureTestingModule({ 12 | declarations: [ PageContentComponent ], 13 | imports: [ RouterTestingModule ], 14 | }) 15 | .compileComponents(); 16 | })); 17 | 18 | beforeEach(() => { 19 | fixture = TestBed.createComponent(PageContentComponent); 20 | component = fixture.componentInstance; 21 | fixture.detectChanges(); 22 | }); 23 | 24 | it('should create', () => { 25 | expect(component).toBeTruthy(); 26 | }); 27 | }); 28 | -------------------------------------------------------------------------------- /src/app/layout/page-content/page-content.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-page-content', 5 | templateUrl: './page-content.component.html', 6 | styleUrls: ['./page-content.component.scss'] 7 | }) 8 | export class PageContentComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/pages/dashboard/dashboard.component.html: -------------------------------------------------------------------------------- 1 |
2 |

Dashboard page

3 |
4 |
5 |
6 |
7 | Featured 8 |
9 |
10 |
Special title treatment
11 |

With supporting text below as a natural lead-in to additional content.

12 | Go somewhere 13 |
14 |
15 |
16 |
17 | Featured 18 |
19 |
20 |
Special title treatment
21 |

With supporting text below as a natural lead-in to additional content.

22 | Go somewhere 23 |
24 |
25 |
26 |
27 |
Card title
28 |
Card subtitle
29 |

Some quick example text to build on the card title and make up the bulk of the card's content.

30 | Card link 31 | Another link 32 |
33 |
34 |
35 |
36 |
Card title
37 |
Card subtitle
38 |

Some quick example text to build on the card title and make up the bulk of the card's content.

39 | Card link 40 | Another link 41 |
42 |
43 |
44 |
45 |
Card title
46 |
Card subtitle
47 |

Some quick example text to build on the card title and make up the bulk of the card's content.

48 | Card link 49 | Another link 50 |
51 |
52 |
53 |
54 |
Card title
55 |
Card subtitle
56 |

Some quick example text to build on the card title and make up the bulk of the card's content.

57 | Card link 58 | Another link 59 |
60 |
61 |
62 |
63 |
Card title
64 |
Card subtitle
65 |

Some quick example text to build on the card title and make up the bulk of the card's content.

66 | Card link 67 | Another link 68 |
69 |
70 |
71 |
72 |
73 | -------------------------------------------------------------------------------- /src/app/pages/dashboard/dashboard.component.scss: -------------------------------------------------------------------------------- 1 | .dashboard-cards { 2 | display: flex; 3 | flex-direction: row; 4 | flex-wrap: wrap; 5 | justify-content:flex-start; 6 | margin: 0 -15px; 7 | >.card { 8 | margin: 15px; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/app/pages/dashboard/dashboard.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { DashboardComponent } from './dashboard.component'; 4 | 5 | describe('DashboardComponent', () => { 6 | let component: DashboardComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ DashboardComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(DashboardComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | it('should render main header in a h2 tag', async(() => { 26 | const compiled = fixture.debugElement.nativeElement; 27 | expect(compiled.querySelector('h2').textContent).toContain('Dashboard page'); 28 | })); 29 | }); 30 | -------------------------------------------------------------------------------- /src/app/pages/dashboard/dashboard.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-dashboard', 5 | templateUrl: './dashboard.component.html', 6 | styleUrls: ['./dashboard.component.scss'] 7 | }) 8 | export class DashboardComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/app/pages/landing-page/landing-page.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |

A simple landing page example

5 |
6 |
7 |
8 |
9 |

Lorem ipsum dolor sit amet

10 |

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do 11 | eiusmod tempor incididunt ut labore et dolore magna aliqua. 12 | Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris 13 | nisi ut aliquip ex ea commodo consequat. 14 |

15 | 21 |
22 |
23 |
24 | -------------------------------------------------------------------------------- /src/app/pages/landing-page/landing-page.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/little-pinecone/angular-multi-layout-scaffolding/671e15c9c5272112b80251583a1ef4b74a040555/src/app/pages/landing-page/landing-page.component.scss -------------------------------------------------------------------------------- /src/app/pages/landing-page/landing-page.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { LandingPageComponent } from './landing-page.component'; 4 | 5 | describe('LandingPageComponent', () => { 6 | let component: LandingPageComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ LandingPageComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(LandingPageComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | it('should render main header in a h2 tag', async(() => { 26 | const compiled = fixture.debugElement.nativeElement; 27 | expect(compiled.querySelector('h2').textContent).toContain('A simple landing page example'); 28 | })); 29 | it('should render sub header in a h3 tag', async(() => { 30 | const compiled = fixture.debugElement.nativeElement; 31 | expect(compiled.querySelector('h3').textContent).toContain('Lorem ipsum dolor sit amet'); 32 | })); 33 | it('should render description in a p tag', async(() => { 34 | const compiled = fixture.debugElement.nativeElement; 35 | expect(compiled.querySelector('p').textContent).toContain('Lorem ipsum dolor sit amet, consectetur adipiscing elit,'); 36 | })); 37 | it('should render feature list', async(() => { 38 | const compiled = fixture.debugElement.nativeElement; 39 | expect(compiled.querySelector('ul').textContent).toContain('Feature 1Feature 2Feature 3Feature 4'); 40 | })); 41 | }); 42 | -------------------------------------------------------------------------------- /src/app/pages/landing-page/landing-page.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-landing-page', 5 | templateUrl: './landing-page.component.html', 6 | styleUrls: ['./landing-page.component.scss'] 7 | }) 8 | export class LandingPageComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/little-pinecone/angular-multi-layout-scaffolding/671e15c9c5272112b80251583a1ef4b74a040555/src/assets/.gitkeep -------------------------------------------------------------------------------- /src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /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 | * In development mode, to ignore zone related error stack frames such as 11 | * `zone.run`, `zoneDelegate.invokeTask` for easier debugging, you can 12 | * import the following file, but please comment it out in production mode 13 | * because it will have performance impact when throw error 14 | */ 15 | // import 'zone.js/dist/zone-error'; // Included with Angular CLI. 16 | -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/little-pinecone/angular-multi-layout-scaffolding/671e15c9c5272112b80251583a1ef4b74a040555/src/favicon.ico -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AngularMultiLayoutScaffolding 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /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'), 20 | reports: ['html', 'lcovonly'], 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 | }); 31 | }; -------------------------------------------------------------------------------- /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.log(err)); 13 | -------------------------------------------------------------------------------- /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/docs/ts/latest/guide/browser-support.html 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/ 22 | // import 'core-js/es6/symbol'; 23 | // import 'core-js/es6/object'; 24 | // import 'core-js/es6/function'; 25 | // import 'core-js/es6/parse-int'; 26 | // import 'core-js/es6/parse-float'; 27 | // import 'core-js/es6/number'; 28 | // import 'core-js/es6/math'; 29 | // import 'core-js/es6/string'; 30 | // import 'core-js/es6/date'; 31 | // import 'core-js/es6/array'; 32 | // import 'core-js/es6/regexp'; 33 | // import 'core-js/es6/map'; 34 | // import 'core-js/es6/weak-map'; 35 | // import 'core-js/es6/set'; 36 | 37 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 38 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 39 | 40 | /** IE10 and IE11 requires the following for the Reflect API. */ 41 | // import 'core-js/es6/reflect'; 42 | 43 | 44 | /** Evergreen browsers require these. **/ 45 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. 46 | import 'core-js/es7/reflect'; 47 | 48 | 49 | /** 50 | * Web Animations `@angular/platform-browser/animations` 51 | * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari. 52 | * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0). 53 | **/ 54 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 55 | 56 | /** 57 | * By default, zone.js will patch all possible macroTask and DomEvents 58 | * user can disable parts of macroTask/DomEvents patch by setting following flags 59 | */ 60 | 61 | // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 62 | // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 63 | // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 64 | 65 | /* 66 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 67 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 68 | */ 69 | // (window as any).__Zone_enable_cross_context_check = true; 70 | 71 | /*************************************************************************************************** 72 | * Zone JS is required by default for Angular itself. 73 | */ 74 | import 'zone.js/dist/zone'; // Included with Angular CLI. 75 | 76 | 77 | 78 | /*************************************************************************************************** 79 | * APPLICATION IMPORTS 80 | */ 81 | -------------------------------------------------------------------------------- /src/styles.scss: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | html { 3 | height: 100%; 4 | } 5 | body { 6 | height: 100%; 7 | } 8 | -------------------------------------------------------------------------------- /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/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "types": [] 6 | }, 7 | "files": [ 8 | "main.ts", 9 | "polyfills.ts" 10 | ], 11 | "include": [ 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.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/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 | -------------------------------------------------------------------------------- /tsconfig.base.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "baseUrl": "./", 5 | "module": "es2020", 6 | "outDir": "./dist/out-tsc", 7 | "sourceMap": true, 8 | "declaration": false, 9 | "moduleResolution": "node", 10 | "emitDecoratorMetadata": true, 11 | "experimentalDecorators": true, 12 | "target": "es5", 13 | "typeRoots": [ 14 | "node_modules/@types" 15 | ], 16 | "lib": [ 17 | "es2017", 18 | "dom" 19 | ] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | /* 2 | This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience. 3 | It is not intended to be used to perform a compilation. 4 | 5 | To learn more about this file see: https://angular.io/config/solution-tsconfig. 6 | */ 7 | { 8 | "files": [], 9 | "references": [ 10 | { 11 | "path": "./src/tsconfig.app.json" 12 | }, 13 | { 14 | "path": "./src/tsconfig.spec.json" 15 | }, 16 | { 17 | "path": "./e2e/tsconfig.e2e.json" 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer" 4 | ], 5 | "rules": { 6 | "arrow-return-shorthand": true, 7 | "callable-types": true, 8 | "class-name": true, 9 | "comment-format": [ 10 | true, 11 | "check-space" 12 | ], 13 | "curly": true, 14 | "deprecation": { 15 | "severity": "warn" 16 | }, 17 | "eofline": true, 18 | "forin": true, 19 | "import-blacklist": [ 20 | true, 21 | "rxjs/Rx" 22 | ], 23 | "import-spacing": true, 24 | "indent": [ 25 | true, 26 | "spaces" 27 | ], 28 | "interface-over-type-literal": true, 29 | "label-position": true, 30 | "max-line-length": [ 31 | true, 32 | 140 33 | ], 34 | "member-access": false, 35 | "member-ordering": [ 36 | true, 37 | { 38 | "order": [ 39 | "static-field", 40 | "instance-field", 41 | "static-method", 42 | "instance-method" 43 | ] 44 | } 45 | ], 46 | "no-arg": true, 47 | "no-bitwise": true, 48 | "no-console": [ 49 | true, 50 | "debug", 51 | "info", 52 | "time", 53 | "timeEnd", 54 | "trace" 55 | ], 56 | "no-construct": true, 57 | "no-debugger": true, 58 | "no-duplicate-super": true, 59 | "no-empty": false, 60 | "no-empty-interface": true, 61 | "no-eval": true, 62 | "no-inferrable-types": [ 63 | true, 64 | "ignore-params" 65 | ], 66 | "no-misused-new": true, 67 | "no-non-null-assertion": true, 68 | "no-shadowed-variable": true, 69 | "no-string-literal": false, 70 | "no-string-throw": true, 71 | "no-switch-case-fall-through": true, 72 | "no-trailing-whitespace": true, 73 | "no-unnecessary-initializer": true, 74 | "no-unused-expression": true, 75 | "no-var-keyword": true, 76 | "object-literal-sort-keys": false, 77 | "one-line": [ 78 | true, 79 | "check-open-brace", 80 | "check-catch", 81 | "check-else", 82 | "check-whitespace" 83 | ], 84 | "prefer-const": true, 85 | "quotemark": [ 86 | true, 87 | "single" 88 | ], 89 | "radix": true, 90 | "semicolon": [ 91 | true, 92 | "always" 93 | ], 94 | "triple-equals": [ 95 | true, 96 | "allow-null-check" 97 | ], 98 | "typedef-whitespace": [ 99 | true, 100 | { 101 | "call-signature": "nospace", 102 | "index-signature": "nospace", 103 | "parameter": "nospace", 104 | "property-declaration": "nospace", 105 | "variable-declaration": "nospace" 106 | } 107 | ], 108 | "unified-signatures": true, 109 | "variable-name": false, 110 | "whitespace": [ 111 | true, 112 | "check-branch", 113 | "check-decl", 114 | "check-operator", 115 | "check-separator", 116 | "check-type" 117 | ], 118 | "no-output-on-prefix": true, 119 | "use-input-property-decorator": true, 120 | "use-output-property-decorator": true, 121 | "use-host-property-decorator": true, 122 | "no-input-rename": true, 123 | "no-output-rename": true, 124 | "use-life-cycle-interface": true, 125 | "use-pipe-transform-interface": true, 126 | "component-class-suffix": true, 127 | "directive-class-suffix": true 128 | } 129 | } 130 | --------------------------------------------------------------------------------