resort.page.ts 597 B

12345678910111213141516171819202122232425262728
  1. import { Component, OnInit } from '@angular/core';
  2. import { ActivatedRoute } from '@angular/router';
  3. import Parse from "parse";
  4. @Component({
  5. selector: 'app-resort',
  6. templateUrl: './resort.page.html',
  7. styleUrls: ['./resort.page.scss'],
  8. })
  9. export class ResortPage implements OnInit {
  10. constructor(private route:ActivatedRoute) { }
  11. ngOnInit() {
  12. this.loadItemsById()
  13. }
  14. items:Parse.Object|undefined
  15. async loadItemsById() {
  16. let id = this.route.snapshot.params["id"]
  17. if(id){
  18. let query = new Parse.Query("Items");
  19. this.items = await query.get(id);
  20. }
  21. }
  22. }