Skip to content

Commit 5f5fe27

Browse files
committed
up
1 parent 0e9a378 commit 5f5fe27

File tree

11 files changed

+96
-11
lines changed

11 files changed

+96
-11
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
"license": "MIT",
55
"scripts": {
66
"ng": "ng",
7-
"start": "ng serve",
7+
"start": "ng serve --proxy-config proxy.config.json",
88
"build": "ng build --prod",
99
"test": "ng test",
1010
"lint": "ng lint",
11-
"e2e": "ng e2e"
11+
"e2e": "ng e2e",
12+
"ng:serve":"ng serve --proxy-config proxy.config.json"
1213
},
1314
"private": true,
1415
"dependencies": {

proxy.conf.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"/api": {
3+
"target": "http://localhost:3000",
4+
"secure": false
5+
}
6+
}

src/app/app-routing.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { PublicSigninComponent } from './public/signin/signin.component';
1010
import { PublicHomeComponent } from './public/home/home.component';
1111
import { AboutComponent } from './private/about/about.component';
1212
import { GalleryComponent } from './private/gallery/gallery.component';
13+
import { DemoChartsComponent } from './private/demo-charts/demo-charts.component';
1314
const routes: Routes = [
1415
{ path: '', redirectTo: 'sign-in', pathMatch: 'full' },
1516
{
@@ -30,6 +31,7 @@ const routes: Routes = [
3031
{ path: 'home', component: PrivateHomeComponent },
3132
{ path: 'about', component: AboutComponent },
3233
{ path: 'gallery', component: GalleryComponent },
34+
{ path: 'demo-charts', component: DemoChartsComponent },
3335

3436
]
3537
}

src/app/app.module.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ import { AlwaysAuthGuard, OnlyLoggedInUsersGuard } from './AlwaysAuthGuard ';
2626
PrivateModule,
2727
ToastrModule.forRoot(),
2828
],
29+
exports: [
30+
ToastrModule,
31+
FormsModule,
32+
],
2933
providers: [
3034
HttpClient,
3135
HTTPService,

src/app/private/demo-charts/demo-charts.component.css

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<!-- <div class="cotainer">
2+
<div [chart]="chart"></div>
3+
</div>> -->
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 { DemoChartsComponent } from './demo-charts.component';
4+
5+
describe('DemoChartsComponent', () => {
6+
let component: DemoChartsComponent;
7+
let fixture: ComponentFixture<DemoChartsComponent>;
8+
9+
beforeEach(async(() => {
10+
TestBed.configureTestingModule({
11+
declarations: [ DemoChartsComponent ]
12+
})
13+
.compileComponents();
14+
}));
15+
16+
beforeEach(() => {
17+
fixture = TestBed.createComponent(DemoChartsComponent);
18+
component = fixture.componentInstance;
19+
fixture.detectChanges();
20+
});
21+
22+
it('should create', () => {
23+
expect(component).toBeTruthy();
24+
});
25+
});
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { Component, OnInit } from '@angular/core';
2+
import { Chart } from 'angular-highcharts';
3+
4+
@Component({
5+
selector: 'app-demo-charts',
6+
templateUrl: './demo-charts.component.html',
7+
styleUrls: ['./demo-charts.component.css']
8+
})
9+
export class DemoChartsComponent implements OnInit {
10+
public chart: Chart = new Chart();
11+
12+
constructor() {
13+
14+
}
15+
16+
ngOnInit() {
17+
18+
// this.chart = new Chart({
19+
// chart: {
20+
// type: 'line'
21+
// },
22+
// title: {
23+
// text: 'Linechart'
24+
// },
25+
// credits: {
26+
// enabled: false
27+
// },
28+
// series: [
29+
// {
30+
// name: 'Line 1',
31+
// data: [1, 2, 3]
32+
// }
33+
// ]
34+
// });
35+
}
36+
37+
}

src/app/private/header/header.component.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,23 @@ <h2><i class="fas fa-home"></i> Admin Panel</h2>
2222
<span class="icon-bar"></span>
2323
</button>
2424
<a class="navbar-brand" href="#">
25-
<span><i class="fas fa-home"></i> Admin Panel</span>
25+
<span>
26+
<i class="fas fa-home"></i> Admin Panel</span>
2627
</a>
2728
</div>
2829
<div class="collapse navbar-collapse" id="myNavbar">
2930
<ul class="nav navbar-nav">
3031
<li [routerLinkActive]="['active']" [routerLink]="['/user/home']">
3132
<a>Home</a>
3233
</li>
34+
<li [routerLinkActive]="['active']" [routerLink]="['/user/demo-charts']">
35+
<a>Charts</a>
36+
</li>
3337
<li [routerLinkActive]="['active']" [routerLink]="['/user/about']">
3438
<a>About</a>
3539
</li>
3640
<li>
37-
<a [routerLinkActive]="['active']" [routerLink]="['/user/gallery']" >Gallery</a>
41+
<a [routerLinkActive]="['active']" [routerLink]="['/user/gallery']">Gallery</a>
3842
</li>
3943
<li>
4044
<a href="javascript:;">Contact</a>

src/app/private/private.module.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NgModule } from '@angular/core';
1+
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
22
import { CommonModule } from '@angular/common';
33
import { PrivateFooterComponent } from './footer/footer.component';
44
import { PrivateHeaderComponent } from './header/header.component';
@@ -11,24 +11,27 @@ import { AboutComponent } from './about/about.component';
1111
import { SharedModule } from '../shared/shared.module';
1212
import { GalleryComponent } from './gallery/gallery.component';
1313
import { EmbedVideo } from 'ngx-embed-video';
14-
import { HttpModule } from '../../../node_modules/@angular/http';
14+
import { DemoChartsComponent } from './demo-charts/demo-charts.component';
15+
import { HttpModule } from '@angular/http';
16+
1517
@NgModule({
1618
imports: [
1719
CommonModule,
18-
AppRoutingModule,
1920
DataTableModule,
2021
TableModule,
2122
HttpModule,
2223
EmbedVideo.forRoot(),
23-
SharedModule
24+
SharedModule,
25+
AppRoutingModule
2426
],
2527
declarations: [
2628
PrivateComponent,
2729
PrivateFooterComponent,
2830
PrivateHeaderComponent,
2931
PrivateHomeComponent,
3032
AboutComponent,
31-
GalleryComponent
33+
GalleryComponent,
34+
DemoChartsComponent
3235
]
3336
})
3437
export class PrivateModule { }

0 commit comments

Comments
 (0)