Skip to content

Commit

Permalink
implement redirection
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelknoch committed Mar 25, 2016
1 parent a628f98 commit 5db133c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
15 changes: 6 additions & 9 deletions app/LocationsComponent/locations.component.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
import {Component} from 'angular2/core';
import {RouteParams, Router} from 'angular2/router';
import {ROUTER_DIRECTIVES} from 'angular2/router';
import {LocationService} from '../services/location.service';

@Component({
templateUrl: './app/locationComponent/template.html',
styleUrls: ['./app/locationComponent/style.css']
templateUrl: './app/LocationsComponent/template.html',
styleUrls: ['./app/LocationsComponent/style.css'],
directives: [ROUTER_DIRECTIVES]
})

export class LocationComponent {
export class LocationsComponent {

locations;

constructor(private _router:Router, private _routeParams:RouteParams, private locationService:LocationService) {

let id = this._routeParams.get('id');
console.info(id);
console.info("jojo");
constructor(private locationService:LocationService) {

locationService.getLocations().subscribe(
data => {
Expand Down
4 changes: 2 additions & 2 deletions app/LocationsComponent/template.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<div class="grid">
<h2>Locations</h2>
<div *ngFor="#location of locations" class="one-quarter location-thumb">
<div *ngFor="#location of locations" class="one-quarter location-thumb"
[routerLink]="['Location', {id: location.obj._id}]">
<div class="back-img"
style="background-image:url('https://locator-app.com{{location.obj.images.normal}}')"></div>
<h3>{{location.obj.title}}</h3>

</div>
</div>

0 comments on commit 5db133c

Please sign in to comment.