Skip to content

Commit ae2a569

Browse files
first commit
1 parent 2ac0ae7 commit ae2a569

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1073
-25
lines changed

angular.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"src/assets"
2929
],
3030
"styles": [
31+
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
3132
"src/styles.scss"
3233
],
3334
"scripts": []
@@ -88,6 +89,7 @@
8889
"src/assets"
8990
],
9091
"styles": [
92+
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
9193
"src/styles.scss"
9294
],
9395
"scripts": []
@@ -119,6 +121,7 @@
119121
}
120122
}
121123
}
122-
}},
124+
}
125+
},
123126
"defaultProject": "dashboard"
124127
}

package-lock.json

Lines changed: 51 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,19 @@
1212
"private": true,
1313
"dependencies": {
1414
"@angular/animations": "~8.0.1",
15+
"@angular/cdk": "^8.2.3",
1516
"@angular/common": "~8.0.1",
1617
"@angular/compiler": "~8.0.1",
1718
"@angular/core": "~8.0.1",
19+
"@angular/flex-layout": "^8.0.0-beta.27",
1820
"@angular/forms": "~8.0.1",
21+
"@angular/material": "^8.2.3",
1922
"@angular/platform-browser": "~8.0.1",
2023
"@angular/platform-browser-dynamic": "~8.0.1",
2124
"@angular/router": "~8.0.1",
25+
"hammerjs": "^2.0.8",
26+
"highcharts": "^7.2.0",
27+
"highcharts-angular": "^2.4.0",
2228
"rxjs": "~6.4.0",
2329
"tslib": "^1.9.0",
2430
"zone.js": "~0.9.1"

src/app/app-routing.module.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
import { NgModule } from '@angular/core';
22
import { Routes, RouterModule } from '@angular/router';
3+
import { DefaultComponent } from './layouts/default/default.component';
4+
import { DashboardComponent } from './modules/dashboard/dashboard.component';
5+
import { PostsComponent } from './modules/posts/posts.component';
36

4-
const routes: Routes = [];
7+
const routes: Routes = [{
8+
path: '',
9+
component: DefaultComponent,
10+
children: [{
11+
path: '',
12+
component: DashboardComponent
13+
}, {
14+
path: 'posts',
15+
component: PostsComponent
16+
}]
17+
}];
518

619
@NgModule({
720
imports: [RouterModule.forRoot(routes)],

src/app/app.component.html

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1 @@
1-
<!--The content below is only a placeholder and can be replaced.-->
2-
<div style="text-align:center">
3-
<h1>
4-
Welcome to {{ title }}!
5-
</h1>
6-
<img width="300" alt="Angular Logo" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg==">
7-
</div>
8-
<h2>Here are some links to help you start: </h2>
9-
<ul>
10-
<li>
11-
<h2><a target="_blank" rel="noopener" href="https://angular.io/tutorial">Tour of Heroes</a></h2>
12-
</li>
13-
<li>
14-
<h2><a target="_blank" rel="noopener" href="https://angular.io/cli">CLI Documentation</a></h2>
15-
</li>
16-
<li>
17-
<h2><a target="_blank" rel="noopener" href="https://blog.angular.io/">Angular blog</a></h2>
18-
</li>
19-
</ul>
20-
21-
<router-outlet></router-outlet>
1+
<router-outlet></router-outlet>

src/app/app.module.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@ import { NgModule } from '@angular/core';
33

44
import { AppRoutingModule } from './app-routing.module';
55
import { AppComponent } from './app.component';
6+
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
7+
import { DefaultModule } from './layouts/default/default.module';
68

79
@NgModule({
810
declarations: [
9-
AppComponent
11+
AppComponent,
1012
],
1113
imports: [
1214
BrowserModule,
13-
AppRoutingModule
15+
AppRoutingModule,
16+
BrowserAnimationsModule,
17+
DefaultModule
1418
],
1519
providers: [],
1620
bootstrap: [AppComponent]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<app-header (toggleSideBarForMe)="sideBarToggler($event)"></app-header>
2+
3+
<mat-drawer-container>
4+
<mat-drawer mode="side" [opened]="sideBarOpen">
5+
<app-sidebar></app-sidebar>
6+
</mat-drawer>
7+
<mat-drawer-content>
8+
<router-outlet></router-outlet>
9+
</mat-drawer-content>
10+
</mat-drawer-container>
11+
12+
<app-footer></app-footer>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
:host {
2+
display: flex;
3+
flex-direction: column;
4+
height: 100%;
5+
}
6+
mat-drawer {
7+
width: 350px;
8+
}
9+
10+
mat-drawer-container {
11+
height: 100%;
12+
}
13+
14+
mat-drawer-content {
15+
padding: 20px;
16+
}
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 { DefaultComponent } from './default.component';
4+
5+
describe('DefaultComponent', () => {
6+
let component: DefaultComponent;
7+
let fixture: ComponentFixture<DefaultComponent>;
8+
9+
beforeEach(async(() => {
10+
TestBed.configureTestingModule({
11+
declarations: [ DefaultComponent ]
12+
})
13+
.compileComponents();
14+
}));
15+
16+
beforeEach(() => {
17+
fixture = TestBed.createComponent(DefaultComponent);
18+
component = fixture.componentInstance;
19+
fixture.detectChanges();
20+
});
21+
22+
it('should create', () => {
23+
expect(component).toBeTruthy();
24+
});
25+
});
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { Component, OnInit } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-default',
5+
templateUrl: './default.component.html',
6+
styleUrls: ['./default.component.scss']
7+
})
8+
export class DefaultComponent implements OnInit {
9+
10+
sideBarOpen = true;
11+
12+
constructor() { }
13+
14+
ngOnInit() { }
15+
16+
17+
sideBarToggler() {
18+
this.sideBarOpen = !this.sideBarOpen;
19+
}
20+
21+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { NgModule } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
3+
import { DefaultComponent } from './default.component';
4+
import { DashboardComponent } from 'src/app/modules/dashboard/dashboard.component';
5+
import { RouterModule } from '@angular/router';
6+
import { PostsComponent } from 'src/app/modules/posts/posts.component';
7+
import { SharedModule } from 'src/app/shared/shared.module';
8+
import { MatSidenavModule, MatDividerModule, MatCardModule, MatPaginatorModule, MatTableModule } from '@angular/material';
9+
import { FlexLayoutModule } from '@angular/flex-layout';
10+
import { DashboardService } from 'src/app/modules/dashboard.service';
11+
12+
@NgModule({
13+
declarations: [
14+
DefaultComponent,
15+
DashboardComponent,
16+
PostsComponent
17+
],
18+
imports: [
19+
CommonModule,
20+
RouterModule,
21+
SharedModule,
22+
MatSidenavModule,
23+
MatDividerModule,
24+
FlexLayoutModule,
25+
MatCardModule,
26+
MatPaginatorModule,
27+
MatTableModule
28+
],
29+
providers: [
30+
DashboardService
31+
]
32+
})
33+
export class DefaultModule { }
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { TestBed } from '@angular/core/testing';
2+
3+
import { DashboardService } from './dashboard.service';
4+
5+
describe('DashboardService', () => {
6+
beforeEach(() => TestBed.configureTestingModule({}));
7+
8+
it('should be created', () => {
9+
const service: DashboardService = TestBed.get(DashboardService);
10+
expect(service).toBeTruthy();
11+
});
12+
});

src/app/modules/dashboard.service.ts

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import { Injectable } from '@angular/core';
2+
3+
@Injectable({
4+
providedIn: 'root'
5+
})
6+
export class DashboardService {
7+
8+
constructor() { }
9+
10+
bigChart() {
11+
return [{
12+
name: 'Asia',
13+
data: [502, 635, 809, 947, 1402, 3634, 5268]
14+
}, {
15+
name: 'Africa',
16+
data: [106, 107, 111, 133, 221, 767, 1766]
17+
}, {
18+
name: 'Europe',
19+
data: [163, 203, 276, 408, 547, 729, 628]
20+
}, {
21+
name: 'America',
22+
data: [18, 31, 54, 156, 339, 818, 1201]
23+
}, {
24+
name: 'Oceania',
25+
data: [2, 2, 2, 6, 13, 30, 46]
26+
}];
27+
}
28+
29+
cards() {
30+
return [71, 78, 39, 66];
31+
}
32+
33+
pieChart() {
34+
return [{
35+
name: 'Chrome',
36+
y: 61.41,
37+
sliced: true,
38+
selected: true
39+
}, {
40+
name: 'Internet Explorer',
41+
y: 11.84
42+
}, {
43+
name: 'Firefox',
44+
y: 10.85
45+
}, {
46+
name: 'Edge',
47+
y: 4.67
48+
}, {
49+
name: 'Safari',
50+
y: 4.18
51+
}, {
52+
name: 'Sogou Explorer',
53+
y: 1.64
54+
}, {
55+
name: 'Opera',
56+
y: 1.6
57+
}, {
58+
name: 'QQ',
59+
y: 1.2
60+
}, {
61+
name: 'Other',
62+
y: 2.61
63+
}];
64+
}
65+
}

0 commit comments

Comments
 (0)