Add some top-nav notes.

This commit is contained in:
James Grogan 2024-04-09 08:27:27 +01:00
parent 180c62a39b
commit 4cff040117
12 changed files with 2313 additions and 14 deletions

View file

@ -91,5 +91,8 @@
} }
} }
} }
},
"cli": {
"analytics": false
} }
} }

File diff suppressed because it is too large Load diff

View file

@ -15,9 +15,11 @@
"@angular/compiler": "^17.1.0", "@angular/compiler": "^17.1.0",
"@angular/core": "^17.1.0", "@angular/core": "^17.1.0",
"@angular/forms": "^17.1.0", "@angular/forms": "^17.1.0",
"@angular/material": "^17.2.2",
"@angular/platform-browser": "^17.1.0", "@angular/platform-browser": "^17.1.0",
"@angular/platform-browser-dynamic": "^17.1.0", "@angular/platform-browser-dynamic": "^17.1.0",
"@angular/router": "^17.1.0", "@angular/router": "^17.1.0",
"ngx-markdown": "^17.1.1",
"rxjs": "~7.8.0", "rxjs": "~7.8.0",
"tslib": "^2.3.0", "tslib": "^2.3.0",
"zone.js": "~0.14.3" "zone.js": "~0.14.3"

View file

@ -1,7 +1,6 @@
<main class="main"> <main class="main">
<div class="content"> <app-top-nav></app-top-nav>
<h1>Welcome to {{ title }}</h1> <div class="content" [innerHTML]="html">
<p>🚧 It's currently getting a facelift 🚧</p>
</div> </div>
</main> </main>

View file

@ -1,13 +1,21 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { RouterOutlet } from '@angular/router'; import { RouterOutlet } from '@angular/router';
import { MarkdownService } from 'ngx-markdown';
import { TopNavComponent } from './top-nav/top-nav.component';
@Component({ @Component({
selector: 'app-root', selector: 'app-root',
standalone: true, standalone: true,
imports: [RouterOutlet], imports: [RouterOutlet, TopNavComponent],
templateUrl: './app.component.html', templateUrl: './app.component.html',
styleUrl: './app.component.css' styleUrl: './app.component.css'
}) })
export class AppComponent { export class AppComponent {
title = "James' personal site"; title = "James' personal site";
markdown = '# Hello, world!';
html: string = "";
constructor(private markdownService: MarkdownService) {
this.html = this.markdownService.parse(this.markdown).valueOf().toString();
}
} }

View file

@ -1,8 +1,14 @@
import { ApplicationConfig } from '@angular/core'; import { ApplicationConfig } from '@angular/core';
import { provideRouter } from '@angular/router'; import { provideRouter } from '@angular/router';
import { provideMarkdown } from 'ngx-markdown';
import { SecurityContext } from '@angular/core';
import { routes } from './app.routes'; import { routes } from './app.routes';
export const appConfig: ApplicationConfig = { export const appConfig: ApplicationConfig = {
providers: [provideRouter(routes)] providers: [provideRouter(routes),
provideMarkdown({
sanitize: SecurityContext.NONE
})]
}; };

View file

@ -0,0 +1,4 @@
export interface MarkdownPage {
name: string;
content: string;
}

View file

@ -0,0 +1 @@
<p>top-nav works!</p>

View file

@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { TopNavComponent } from './top-nav.component';
describe('TopNavComponent', () => {
let component: TopNavComponent;
let fixture: ComponentFixture<TopNavComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [TopNavComponent]
})
.compileComponents();
fixture = TestBed.createComponent(TopNavComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View file

@ -0,0 +1,12 @@
import { Component } from '@angular/core';
@Component({
selector: 'app-top-nav',
standalone: true,
imports: [],
templateUrl: './top-nav.component.html',
styleUrl: './top-nav.component.css'
})
export class TopNavComponent {
}

View file

@ -0,0 +1,4 @@
export interface TopNavOption {
name: string;
route: string;
}