Last change
on this file since 188ee53 was fa375fe, checked in by Ema <ema_spirova@…>, 3 years ago |
adding new components
|
-
Property mode
set to
100644
|
File size:
1.2 KB
|
Rev | Line | |
---|
[6a3a178] | 1 | import { Component, OnInit } from '@angular/core';
|
---|
| 2 | import { Category } from '../_models/category';
|
---|
| 3 | import { City } from '../_models/city';
|
---|
| 4 | import { Companion } from '../_models/companion';
|
---|
| 5 | import { Country } from '../_models/country';
|
---|
| 6 | import { CategoryService } from '../_services/cateogry.service';
|
---|
| 7 | import { CityService } from '../_services/city.service';
|
---|
| 8 | import { CompanionService } from '../_services/companion.service';
|
---|
| 9 | import { CountryService } from '../_services/country.service';
|
---|
| 10 |
|
---|
| 11 | @Component({
|
---|
| 12 | selector: 'app-location',
|
---|
| 13 | templateUrl: './location.component.html',
|
---|
| 14 | styleUrls: ['./location.component.css']
|
---|
| 15 | })
|
---|
| 16 | export class LocationComponent implements OnInit {
|
---|
| 17 |
|
---|
| 18 | categories: Category[];
|
---|
| 19 | companions: Companion[];
|
---|
[fa375fe] | 20 | constructor(private categoryService: CategoryService, private companionService : CompanionService) {
|
---|
[6a3a178] | 21 | this.categories = [];
|
---|
| 22 | this.companions = [];
|
---|
| 23 | }
|
---|
| 24 |
|
---|
| 25 | ngOnInit(): void {
|
---|
| 26 | this.categoryService.getAllCategories().subscribe(
|
---|
| 27 | data => {
|
---|
| 28 | this.categories = data;
|
---|
| 29 | console.log(data);
|
---|
| 30 | }
|
---|
| 31 | );
|
---|
| 32 |
|
---|
| 33 | this.companionService.getAllCompanions().subscribe(
|
---|
| 34 | data => {
|
---|
| 35 | this.companions = data;
|
---|
| 36 | }
|
---|
| 37 | );
|
---|
| 38 | }
|
---|
| 39 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.