Skip to content
This repository was archived by the owner on Oct 14, 2024. It is now read-only.

Commit 936a452

Browse files
MarkPieszakFabian Wiles
authored andcommitted
styles(app): update overall app styles (#659)
1 parent d286347 commit 936a452

File tree

4 files changed

+51
-17
lines changed

4 files changed

+51
-17
lines changed

src/app/app.component.ts

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,41 @@ import {Component} from '@angular/core';
33
@Component({
44
selector: 'app-root',
55
template: `
6-
<h1>Universal Demo using Angular and Angular CLI</h1>
7-
<a routerLink="/">Home</a>
8-
<a routerLink="/lazy">Lazy</a>
9-
<a routerLink="/lazy/nested">Lazy_Nested</a>
10-
<router-outlet></router-outlet>
6+
<div class="app-container">
7+
<h1>Angular Universal Demo utilizing Angular & Angular CLI</h1>
8+
<nav class="nav-links">
9+
<a routerLink="/">Home</a>
10+
<a routerLink="/lazy">Lazy-loaded Route</a>
11+
<a routerLink="/lazy/nested">Nested Routes work too</a>
12+
</nav>
13+
<div class="router-container">
14+
<router-outlet></router-outlet>
15+
</div>
16+
</div>
1117
`,
12-
styles: []
18+
styles: [`
19+
:host {
20+
background: #f1f1f1;
21+
font-family: Roboto,"Helvetica Neue Light","Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif;
22+
font-display: swap;
23+
}
24+
.nav-links {
25+
background: #008591;
26+
}
27+
.nav-links a {
28+
color: #fff;
29+
display: inline-block;
30+
padding: 1rem;
31+
margin-right: 3rem;
32+
text-decoration: none;
33+
font-weight: bold;
34+
letter-spacing: 0.1rem;
35+
}
36+
.router-container {
37+
border: 0.5rem #00afc4 solid;
38+
padding: 2rem;
39+
}
40+
`]
1341
})
1442
export class AppComponent {
1543

src/app/app.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import {BrowserModule} from '@angular/platform-browser';
22
import {NgModule} from '@angular/core';
33
import {RouterModule} from '@angular/router';
44

5-
import { AppComponent } from './app.component';
6-
import { HomeComponent } from './home/home.component';
5+
import {AppComponent} from './app.component';
6+
import {HomeComponent} from './home/home.component';
77
import {TransferHttpCacheModule} from '@nguniversal/common';
88

99
@NgModule({

src/app/home/home.component.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
import {Component, OnInit} from '@angular/core';
1+
import {Component} from '@angular/core';
22

33
@Component({
44
selector: 'app-home',
5-
template: `<h3>{{ message }}</h3>`
5+
template: `
6+
<h3>{{ message }}</h3>
7+
<img [src]="image">
8+
`
69
})
7-
export class HomeComponent implements OnInit {
8-
public message: string;
10+
export class HomeComponent {
11+
public message = `Angular Universal`;
12+
// tslint:disable-next-line:max-line-length
13+
public image = 'https://camo.githubusercontent.com/81f72f2fdf98aa1d30b5b215bc8ca9420b249e81/68747470733a2f2f616e67756c61722e696f2f67656e6572617465642f696d616765732f6d61726b6574696e672f636f6e636570742d69636f6e732f756e6976657273616c2e706e67';
914

1015
constructor() {}
11-
12-
ngOnInit() {
13-
this.message = 'Hello';
14-
}
1516
}

src/app/lazy/lazy.module.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ import {RouterModule} from '@angular/router';
33

44
@Component({
55
selector: 'app-lazy-view',
6-
template: `<h3>i'm lazy</h3>`
6+
template: `
7+
<h3>This is content from a lazy-loaded route</h3>
8+
<div>Check your Networks tab to see that the js file got loaded</div>
9+
<br>
10+
<div><em>/lazy/nested/</em> routes to the same page</div>
11+
`
712
})
813
export class LazyComponent {}
914

0 commit comments

Comments
 (0)