UNPKG

@nativescript/template-hello-world-ng-vision

Version:
21 lines (16 loc) 533 B
import { Component, OnInit } from '@angular/core' import { ActivatedRoute } from '@angular/router' import { Item } from './item' import { ItemService } from './item.service' @Component({ selector: 'ns-details', templateUrl: './item-detail.component.html', }) export class ItemDetailComponent implements OnInit { item: Item constructor(private itemService: ItemService, private route: ActivatedRoute) {} ngOnInit(): void { const id = +this.route.snapshot.params.id this.item = this.itemService.getItem(id) } }