Skip to content

Commit 6194284

Browse files
committed
Newroute and Theming tutorials
1 parent 2f10146 commit 6194284

12 files changed

+66
-5
lines changed

cloudapp/src/app/app-routing.module.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
import { NgModule } from '@angular/core';
22
import { Routes, RouterModule } from '@angular/router';
33
import { MainComponent } from './main/main.component';
4+
import { NewrouteComponent } from './newroute/newroute.component';
5+
import { ThemingComponent } from './theming/theming.component';
46

57
const routes: Routes = [
6-
{ path: '', component: MainComponent }
8+
{ path: '', component: MainComponent },
9+
{ path: 'newroute', component: NewrouteComponent },
10+
{ path: 'theming', component: ThemingComponent },
711
];
812

913
@NgModule({

cloudapp/src/app/app.module.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import { AppComponent } from './app.component';
99
import { AppRoutingModule } from './app-routing.module';
1010
import { MainComponent } from './main/main.component';
1111
import { TopmenuComponent } from './topmenu/topmenu.component';
12+
import { NewrouteComponent } from './newroute/newroute.component';
13+
import { ThemingComponent } from './theming/theming.component';
1214

1315
export function getToastrModule() {
1416
return ToastrModule.forRoot({
@@ -21,7 +23,9 @@ export function getToastrModule() {
2123
declarations: [
2224
AppComponent,
2325
MainComponent,
24-
TopmenuComponent
26+
TopmenuComponent,
27+
NewrouteComponent,
28+
ThemingComponent,
2529
],
2630
imports: [
2731
MaterialModule,

cloudapp/src/app/main/main.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ <h1>
44
</h1>
55
<p>This app includes all of the code referenced in the <a href="https://developers.exlibrisgroup.com/cloudapps/tutorials" target="_blank">tutorials section of the CloudApps documentation</a>. The following menu will lead you to the component referenced in the corresponding tutorial:</p>
66
<ul>
7-
7+
<li><a [routerLink]="['newroute']">Adding additional routes</a></li>
8+
<li><a [routerLink]="['theming']">Using Material Components & Theming</a></li>
89
</ul>
910
</section>
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Component, OnInit } from '@angular/core';
2+
import { AppService } from '../app.service';
23

34
@Component({
45
selector: 'app-main',
@@ -7,8 +8,10 @@ import { Component, OnInit } from '@angular/core';
78
})
89
export class MainComponent implements OnInit {
910

10-
constructor() { }
11+
constructor(private appService: AppService) { }
1112

12-
ngOnInit() { }
13+
ngOnInit() {
14+
this.appService.setTitle('');
15+
}
1316

1417
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<p>newroute works!</p>

cloudapp/src/app/newroute/newroute.component.scss

Whitespace-only changes.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { Component, OnInit } from '@angular/core';
2+
import { AppService } from '../app.service';
3+
4+
@Component({
5+
selector: 'app-newroute',
6+
templateUrl: './newroute.component.html',
7+
styleUrls: ['./newroute.component.scss']
8+
})
9+
export class NewrouteComponent implements OnInit {
10+
11+
constructor(private appService: AppService) { }
12+
13+
ngOnInit() {
14+
this.appService.setTitle('New Route');
15+
}
16+
17+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<p>Here's a button using the primary color:</p>
2+
<p><button mat-raised-button color="primary">Primary</button></p>
3+
<div class="themed-box">And here's a box with a border color determined by the theme.</div>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.themed-box {
2+
padding: 10px;
3+
border: 5px solid;
4+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@mixin theming-component-theme($theme, $typgraphy) {
2+
.themed-box {
3+
border-color: mat-color(map-get($theme, primary));
4+
}
5+
}

0 commit comments

Comments
 (0)