You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
495 B
24 lines
495 B
import { Component, OnInit } from '@angular/core';
|
|
import { ActivatedRoute } from '@angular/router';
|
|
import { USERS } from './users';
|
|
|
|
@Component({
|
|
selector: 'app-user',
|
|
templateUrl: './user.component.html',
|
|
styleUrls: ['./user.component.css']
|
|
})
|
|
export class UserComponent implements OnInit {
|
|
user: String;
|
|
|
|
constructor(
|
|
private route: ActivatedRoute
|
|
) { }
|
|
|
|
ngOnInit() {
|
|
this.route.params.forEach(param => {
|
|
this.user = USERS[param.index];
|
|
})
|
|
}
|
|
|
|
}
|