Created
April 13, 2017 04:38
-
-
Save bolerap/c6f241dd68f020bc30b95ca2dad98608 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 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