Skip to content

Instantly share code, notes, and snippets.

@bolerap
Created April 13, 2017 04:38
Show Gist options
  • Select an option

  • Save bolerap/c6f241dd68f020bc30b95ca2dad98608 to your computer and use it in GitHub Desktop.

Select an option

Save bolerap/c6f241dd68f020bc30b95ca2dad98608 to your computer and use it in GitHub Desktop.
import "rxjs/add/operator/switchMap";
import {Component, OnInit} from "@angular/core";
import {ActivatedRoute} from "@angular/router";
@Component({
selector: 'app-card',
templateUrl: './card.component.html',
styleUrls: ['./card.component.css']
})
export class CardComponent implements OnInit {
imagePath = '';
constructor(private route: ActivatedRoute) {
}
ngOnInit() {
let fileId = this.route.snapshot.paramMap.get("path");
// build path from response data
this.imagePath = `download/${fileId}.png`;
console.log('ngOnInit: ', this.imagePath);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment