Skip to content

Commit

Permalink
Complete sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
fboeller committed Mar 7, 2021
1 parent b6fb004 commit 3a09a43
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 5 deletions.
2 changes: 1 addition & 1 deletion projects/example-app/src/app/app.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
grid-template-columns: 300px auto;
}

.sidebar {
app-sidebar {
grid-area: "sidebar";
}

Expand Down
4 changes: 1 addition & 3 deletions projects/example-app/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<div class="sidebar">
<a routerLink="/examples/default">Default</a>
</div>
<app-sidebar></app-sidebar>
<div class="main">
<router-outlet></router-outlet>
</div>
3 changes: 2 additions & 1 deletion projects/example-app/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';
import { RouterModule } from '@angular/router';
import { SidebarComponent } from './sidebar/sidebar.component';

@NgModule({
declarations: [AppComponent],
declarations: [AppComponent, SidebarComponent],
imports: [
BrowserModule,
RouterModule.forRoot([
Expand Down
13 changes: 13 additions & 0 deletions projects/example-app/src/app/sidebar/sidebar.component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
:host {
display: block;
}

.links {
display: flex;
flex-direction: column;
gap: 10px;
}

.links > a {
display: block;
}
8 changes: 8 additions & 0 deletions projects/example-app/src/app/sidebar/sidebar.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<h3>Examples</h3>
<div class="links">
<a routerLink="/examples/default">Default</a>
<a routerLink="/examples/custom-default-loading">Custom default loading</a>
<a routerLink="/examples/ngrx">NgRx</a>
<a routerLink="/examples/custom-loading-template">Custom loading template</a>
<a routerLink="/examples/lightweight">Lightweight</a>
</div>
27 changes: 27 additions & 0 deletions projects/example-app/src/app/sidebar/sidebar.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/* tslint:disable:no-unused-variable */
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';

import { SidebarComponent } from './sidebar.component';

describe('SidebarComponent', () => {
let component: SidebarComponent;
let fixture: ComponentFixture<SidebarComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [SidebarComponent],
}).compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(SidebarComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
8 changes: 8 additions & 0 deletions projects/example-app/src/app/sidebar/sidebar.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { Component } from '@angular/core';

@Component({
selector: 'app-sidebar',
templateUrl: './sidebar.component.html',
styleUrls: ['./sidebar.component.css'],
})
export class SidebarComponent {}

0 comments on commit 3a09a43

Please sign in to comment.