Skip to content

Commit 79b3a7c

Browse files
author
Vishwas Gopinath - I16165
committed
Events and special events API
1 parent 90558cb commit 79b3a7c

9 files changed

+105
-0
lines changed

ngApp/src/app/event.service.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Injectable } from '@angular/core';
2+
import { HttpClient } from '@angular/common/http'
3+
4+
@Injectable()
5+
export class EventService {
6+
7+
private _eventsUrl = "/api/events";
8+
private _specialEventsUrl = "/api/events/special";
9+
10+
constructor(private http: HttpClient) { }
11+
12+
getEvents() {
13+
return this.http.get(this._eventsUrl)
14+
}
15+
16+
getSpecialEvents() {
17+
return this.http.get(this._specialEventsUrl)
18+
}
19+
}

ngApp/src/app/events/events.component.css

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<p>
2+
events works!
3+
</p>
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 { EventsComponent } from './events.component';
4+
5+
describe('EventsComponent', () => {
6+
let component: EventsComponent;
7+
let fixture: ComponentFixture<EventsComponent>;
8+
9+
beforeEach(async(() => {
10+
TestBed.configureTestingModule({
11+
declarations: [ EventsComponent ]
12+
})
13+
.compileComponents();
14+
}));
15+
16+
beforeEach(() => {
17+
fixture = TestBed.createComponent(EventsComponent);
18+
component = fixture.componentInstance;
19+
fixture.detectChanges();
20+
});
21+
22+
it('should create', () => {
23+
expect(component).toBeTruthy();
24+
});
25+
});
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Component, OnInit } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-events',
5+
templateUrl: './events.component.html',
6+
styleUrls: ['./events.component.css']
7+
})
8+
export class EventsComponent implements OnInit {
9+
10+
constructor() { }
11+
12+
ngOnInit() {
13+
}
14+
15+
}

ngApp/src/app/special-events/special-events.component.css

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<p>
2+
special-events works!
3+
</p>
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 { SpecialEventsComponent } from './special-events.component';
4+
5+
describe('SpecialEventsComponent', () => {
6+
let component: SpecialEventsComponent;
7+
let fixture: ComponentFixture<SpecialEventsComponent>;
8+
9+
beforeEach(async(() => {
10+
TestBed.configureTestingModule({
11+
declarations: [ SpecialEventsComponent ]
12+
})
13+
.compileComponents();
14+
}));
15+
16+
beforeEach(() => {
17+
fixture = TestBed.createComponent(SpecialEventsComponent);
18+
component = fixture.componentInstance;
19+
fixture.detectChanges();
20+
});
21+
22+
it('should create', () => {
23+
expect(component).toBeTruthy();
24+
});
25+
});
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Component, OnInit } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-special-events',
5+
templateUrl: './special-events.component.html',
6+
styleUrls: ['./special-events.component.css']
7+
})
8+
export class SpecialEventsComponent implements OnInit {
9+
10+
constructor() { }
11+
12+
ngOnInit() {
13+
}
14+
15+
}

0 commit comments

Comments
 (0)