-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
855b59a
commit 23f88ef
Showing
11 changed files
with
5,620 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
node_modules/ | ||
.idea | ||
typings | ||
|
||
*.js | ||
*js.map | ||
*js.map | ||
app/components |
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 |
---|---|---|
@@ -1,28 +1,28 @@ | ||
import {Component} from 'angular2/core'; | ||
import {RouteParams, Router} from 'angular2/router'; | ||
import {LocationService} from '../services/location.service' | ||
import {LocationService} from '../services/location.service'; | ||
|
||
@Component({ | ||
template: '<h2>Location</h2>' | ||
templateUrl: './app/locationComponent/template.html' | ||
}) | ||
export class LocationComponent implements OnInit { | ||
|
||
location:Location; | ||
export class LocationComponent { | ||
|
||
constructor(private _router:Router, | ||
private _routeParams:RouteParams, | ||
private _locationService:LocationService) { | ||
locations:Locations; | ||
|
||
_locationService.locations | ||
.subscribe( | ||
people => this.people = people, | ||
error => console.error('Error: ' + err), | ||
() => console.log('Completed!') | ||
); | ||
} | ||
constructor(private _router:Router, private _routeParams:RouteParams, private locationService:LocationService) { | ||
|
||
ngOnInit() { | ||
let id = this._routeParams.get('id'); | ||
console.info(id); | ||
console.info("jojo"); | ||
|
||
locationService.getLocations().subscribe( | ||
data => { | ||
this.locations = data; | ||
console.info(this.locations); | ||
}, | ||
err => console.err(err) | ||
); | ||
} | ||
|
||
} |
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,9 @@ | ||
<div class="grid"> | ||
<h2>Locations</h2> | ||
<div *ngFor="#location of locations" class="one-quarter location-thumb"> | ||
<div class="back-img" | ||
style="background-image:url('https://locator-app.com{{location.obj.images.normal}}')"></div> | ||
<h3>{{location.obj.title}}</h3> | ||
|
||
</div> | ||
</div> |
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
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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import {AppComponent} from './app.component'; | ||
import {bootstrap} from 'angular2/platform/browser'; | ||
import {ROUTER_PROVIDERS} from 'angular2/router'; | ||
import {HTTP_PROVIDERS} from 'angular2/http'; | ||
|
||
|
||
bootstrap(AppComponent, [ | ||
ROUTER_PROVIDERS | ||
ROUTER_PROVIDERS, HTTP_PROVIDERS | ||
]); |
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 |
---|---|---|
@@ -1,12 +1,16 @@ | ||
import {Injectable} from 'angular2/angular2'; | ||
import {Http} from 'angular2/http'; | ||
import {Injectable} from 'angular2/core'; | ||
import {Http, HTTP_PROVIDERS} from 'angular2/http'; | ||
import 'rxjs/Rx'; | ||
|
||
@Injectable() | ||
export class LocationService { | ||
|
||
constructor(http:Http) { | ||
this.locations = http.get("http://locator.in.htwg-konstanz.de:2020/locations/nearby?long=9.169753789901733&lat=47.66868204997508&maxDistance=100000000000&limit=1000000000") | ||
.map(response => response.json()); | ||
this.http = http; | ||
} | ||
} | ||
|
||
getLocations() { | ||
return this.http.get('./mock.json') | ||
.map(res => res.json()) | ||
} | ||
} |
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,21 @@ | ||
{ | ||
"name": "locator-dash", | ||
"description": "dashboard", | ||
"main": "", | ||
"authors": [ | ||
"Michael Knoch <[email protected]>" | ||
], | ||
"license": "ISC", | ||
"private": true, | ||
"ignore": [ | ||
"**/.*", | ||
"node_modules", | ||
"bower_components", | ||
"app/components", | ||
"test", | ||
"tests" | ||
], | ||
"dependencies": { | ||
"gridism": "^0.2.1" | ||
} | ||
} |
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
Oops, something went wrong.