Skip to content

Commit dcba91a

Browse files
committed
added a more complex example and created new folders to distinguish between simple and complex examples
1 parent 0487484 commit dcba91a

30 files changed

+1572
-0
lines changed
File renamed without changes.
File renamed without changes.

charts/minimalLineChart/src/app/app.component.css

Whitespace-only changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<h1>
2+
Consumption charts
3+
</h1>
4+
<consumption></consumption>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/* tslint:disable:no-unused-variable */
2+
3+
import { TestBed, async } from '@angular/core/testing';
4+
import { AppComponent } from './app.component';
5+
6+
describe('AppComponent', () => {
7+
beforeEach(() => {
8+
TestBed.configureTestingModule({
9+
declarations: [
10+
AppComponent
11+
],
12+
});
13+
});
14+
15+
it('should create the app', async(() => {
16+
let fixture = TestBed.createComponent(AppComponent);
17+
let app = fixture.debugElement.componentInstance;
18+
expect(app).toBeTruthy();
19+
}));
20+
21+
it(`should have as title 'app works!'`, async(() => {
22+
let fixture = TestBed.createComponent(AppComponent);
23+
let app = fixture.debugElement.componentInstance;
24+
expect(app.title).toEqual('app works!');
25+
}));
26+
27+
it('should render title in a h1 tag', async(() => {
28+
let fixture = TestBed.createComponent(AppComponent);
29+
fixture.detectChanges();
30+
let compiled = fixture.debugElement.nativeElement;
31+
expect(compiled.querySelector('h1').textContent).toContain('app works!');
32+
}));
33+
});
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-root',
5+
templateUrl: './app.component.html',
6+
styleUrls: ['./app.component.css']
7+
})
8+
export class AppComponent {
9+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import {NgModule} from '@angular/core';
2+
import {NgxChartsModule} from "@swimlane/ngx-charts";
3+
import {BrowserModule} from "@angular/platform-browser";
4+
import {HttpModule} from "@angular/http";
5+
import {FormsModule} from "@angular/forms";
6+
import {AppComponent} from "./app.component";
7+
import {ConsumptionComponent} from "./consumption/consumption.component";
8+
import {ConsumptionDataService} from "./services/consumption-data-service";
9+
10+
@NgModule({
11+
declarations: [
12+
AppComponent,
13+
ConsumptionComponent
14+
],
15+
imports: [
16+
BrowserModule,
17+
FormsModule,
18+
HttpModule,
19+
NgxChartsModule
20+
],
21+
exports: [],
22+
providers: [ConsumptionDataService],
23+
bootstrap: [AppComponent]
24+
})
25+
export class AppModule {
26+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import {SeriesEntry} from "./SeriesEntry"
2+
3+
export class Series {
4+
constructor(public name: string, public series: SeriesEntry[]) {}
5+
}
6+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export class SeriesEntry {
2+
constructor(public name: string | Date, public value: number) {}
3+
}
4+

0 commit comments

Comments
 (0)