-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: moving events to json with service
- Loading branch information
ijz953
committed
Mar 13, 2019
1 parent
79ebec6
commit 63adf95
Showing
5 changed files
with
115 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
[ | ||
{ | ||
"name": "NgColombia", | ||
"url": "http://www.ngcolombia.com", | ||
"location": "Medellín, Colombia", | ||
"startDate": "09-06-2018", | ||
"endDate": "09-07-2018" | ||
}, | ||
{ | ||
"name": "DevFestATL", | ||
"url": "http://devfestatl.com", | ||
"location": "Atlanta, Georgia", | ||
"endDate": "09-22-2018" | ||
}, | ||
{ | ||
"name": "Framework Summit", | ||
"url": "http://frameworksummit.com", | ||
"location": "Park City, Utah", | ||
"endDate": "09-22-2018" | ||
}, | ||
{ | ||
"name": "DevFestATL", | ||
"url": "http://devfestatl.com", | ||
"location": "Atlanta, Georgia", | ||
"startDate": "10-02-2018", | ||
"endDate": "10-03-2018" | ||
}, | ||
{ | ||
"name": "AngularMix - Use the discount code "RYAN" or "ROBERTS" to receive $50 off your registration!", | ||
"url": "http://www.angularmix.com", | ||
"location": "Orlando, Florida", | ||
"startDate": "10-10-2018", | ||
"endDate": "10-12-2018" | ||
}, | ||
{ | ||
"name": "AngularConnect", "url": "http://www.angularconnect.com", "location": "Excel, London", "startDate": "11-06-2018", "endDate": "11-07-2018"}, | ||
{ | ||
"name": "ngAtlanta", "url": "http://ng-atl.org/", "location": "Atlanta, Georgia", "startDate": "01-09-2019", "endDate": "01-12-2019"}, | ||
{ | ||
"name": "ng-India", "url": "https://www.ng-ind.com", "location": "Gurgaon, India", "endDate": "02-23-2019"}, | ||
{ | ||
"name": "Open Source 101", "url": "https://opensource101.com/", "location": "Columbia, South Carolina", "endDate": "04-18-2019"}, | ||
{ | ||
"name": "NG-Conf", "url": "https://www.ng-conf.org", "location": "Salt Lake City, Utah", "startDate": "05-01-2019", "endDate": "05-03-2019"}, | ||
{ | ||
"name": "ngVikings", "url": "https://ngvikings.org/", "location": "Copenhagen, Denmark", "startDate": "05-26-2019", "endDate": "05-28-2019"}, | ||
{ | ||
"name": "REFACTR.TECH", "url": "https://refactr.tech/", "location": "Atlanta, Georgia", "startDate": "06-05-2019", "endDate": "06-07-2019"}, | ||
{ | ||
"name": "AngularUP", "url": "https://angular-up.com/", "location": "Tel Aviv, Israel", "endDate": "06-12-2019"}, | ||
{ | ||
"name": "NG-MY", "url": "https://ng-my.org/", "location": "Kuala Lumpur, Malaysia", "startDate": "07-06-2019", "endDate": "07-07-2019"}, | ||
{ | ||
"name": "ngDenver", "url": "http://angulardenver.com/", "location": "Denver, Colorado", "startDate": "08-01-2019", "endDate": "08-02-2019"}, | ||
{ | ||
"name": "AngularConnect", "url": "https://www.angularconnect.com/", "location": "London, United Kingdom", "startDate": "09-19-2019", "endDate": "09-20-2019"}, | ||
{ | ||
"name": "NG-Rome", "url": "https://ngrome.io/", "location": "Rome, Italy", "endDate": "10-07-2019"} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
projects/ngrx.io/src/app/custom-elements/events/event.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { HttpClient } from '@angular/common/http'; | ||
|
||
import { ConnectableObservable, Observable } from 'rxjs'; | ||
import { tap, publishLast } from 'rxjs/operators'; | ||
|
||
import { CONTENT_URL_PREFIX } from 'app/documents/document.service'; | ||
import { Event } from './event.model'; | ||
|
||
const resourcesPath = CONTENT_URL_PREFIX + 'events.json'; | ||
|
||
@Injectable() | ||
export class EventService { | ||
events: Observable<Event[]>; | ||
|
||
constructor(private http: HttpClient) { | ||
this.events = this.getEvents(); | ||
} | ||
|
||
private getEvents(): Observable<Event[]> { | ||
|
||
const events = this.http.get<Event[]>(resourcesPath).pipe( | ||
tap(event => console.log('service: ' + event)), | ||
publishLast(), | ||
); | ||
|
||
(events as ConnectableObservable<Event[]>).connect(); | ||
return events; | ||
}; | ||
} |