Skip to content

Commit 8667966

Browse files
author
sowvikr
committed
Example updated.
1 parent ffd620a commit 8667966

24 files changed

+3787
-5
lines changed

src/app/app-routing.module.ts

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,34 @@
11
import { NgModule } from '@angular/core';
22
import { Routes, RouterModule } from '@angular/router';
3+
import {DarkThemeComponent} from './pages/dark-theme/dark-theme.component';
4+
import {StandardThemeComponent} from './pages/standard-theme/standard-theme.component';
5+
import {MaterialThemeComponent} from './pages/material-theme/material-theme.component';
6+
import {AllThemeComponent} from './pages/all-theme/all-theme.component';
7+
import {RedThemeComponent} from './pages/red-theme/red-theme.component';
38

4-
const routes: Routes = [];
9+
10+
const routes: Routes = [
11+
{
12+
path: '',
13+
component: StandardThemeComponent,
14+
},
15+
{
16+
path: 'dark',
17+
component: DarkThemeComponent,
18+
},
19+
{
20+
path: 'material',
21+
component: MaterialThemeComponent,
22+
},
23+
{
24+
path: 'all',
25+
component: AllThemeComponent,
26+
},
27+
{
28+
path: 'blue',
29+
component: RedThemeComponent,
30+
},
31+
];
532

633
@NgModule({
734
imports: [RouterModule.forRoot(routes)],

src/app/app.component.html

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
<!--The content below is only a placeholder and can be replaced.-->
2-
<data-grid [commonSearch]="commonSearch" [pagination]="pagination" [theme]="theme"
3-
[columnDefs]="columnDefs" [rowData]="rowData"></data-grid>
2+
<div class="page-container">
3+
<div class="theme-links">
4+
<button mat-raised-button color="primary" [routerLink]="''">Standard</button>
5+
<button mat-raised-button color="primary" [routerLink]="'dark'">Dark</button>
6+
<button mat-raised-button color="primary" [routerLink]="'blue'">New Bootstrap</button>
7+
<button mat-raised-button color="primary" [routerLink]="'material'">Material</button>
8+
<button mat-raised-button color="primary" [routerLink]="'all'">All Themes</button>
9+
</div>
10+
<router-outlet></router-outlet>
411

5-
<router-outlet></router-outlet>
12+
</div>

src/app/app.component.scss

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
.page-container{
2+
margin: 0 60px;
3+
@media only screen and (max-width: 600px) {
4+
margin: 0;
5+
}
6+
}
7+
.theme-links{
8+
display: inline-block;
9+
margin: 15px 0;
10+
float: right;
11+
@media only screen and (max-width: 600px) {
12+
width: 100%;
13+
}
14+
button{
15+
display: inline-block;
16+
margin-left: 20px;
17+
color: white;
18+
background: #232323;
19+
text-decoration: none;
20+
border-radius: 3px;
21+
22+
@media only screen and (max-width: 600px) {
23+
display: block;
24+
width: 100%;
25+
text-align: center;
26+
margin-bottom: 10px;
27+
margin-left: 0;
28+
}
29+
}
30+
}

src/app/app.module.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,20 @@ import { NgModule } from '@angular/core';
44
import { AppRoutingModule } from './app-routing.module';
55
import { AppComponent } from './app.component';
66
import {AngularOpenDatagridModule} from 'angular-open-datagrid';
7+
import {AllThemeComponent} from "./pages/all-theme/all-theme.component";
8+
import {MaterialThemeComponent} from "./pages/material-theme/material-theme.component";
9+
import {RedThemeComponent} from "./pages/red-theme/red-theme.component";
10+
import {StandardThemeComponent} from "./pages/standard-theme/standard-theme.component";
11+
import {DarkThemeComponent} from "./pages/dark-theme/dark-theme.component";
712

813
@NgModule({
914
declarations: [
10-
AppComponent
15+
AppComponent,
16+
DarkThemeComponent,
17+
StandardThemeComponent,
18+
RedThemeComponent,
19+
MaterialThemeComponent,
20+
AllThemeComponent,
1121
],
1222
imports: [
1323
BrowserModule,
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
<div *ngFor="let dataTable of dataTables">
3+
<data-grid [commonSearch]="commonSearch" [pagination]="dataTable.pagination" [theme]="dataTable.theme"
4+
[columnDefs]="dataTable.columnDefs" [rowData]="dataTable.rowData"></data-grid>
5+
</div>

src/app/pages/all-theme/all-theme.component.scss

Whitespace-only changes.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { AllThemeComponent } from './all-theme.component';
4+
5+
describe('AllThemeComponent', () => {
6+
let component: AllThemeComponent;
7+
let fixture: ComponentFixture<AllThemeComponent>;
8+
9+
beforeEach(async(() => {
10+
TestBed.configureTestingModule({
11+
declarations: [ AllThemeComponent ]
12+
})
13+
.compileComponents();
14+
}));
15+
16+
beforeEach(() => {
17+
fixture = TestBed.createComponent(AllThemeComponent);
18+
component = fixture.componentInstance;
19+
fixture.detectChanges();
20+
});
21+
22+
it('should create', () => {
23+
expect(component).toBeTruthy();
24+
});
25+
});

0 commit comments

Comments
 (0)