Jeden komponent w drugim

0

Cześć. Chciałbym dodać do jednego kompontu drugi ale nic się nie dzieje tutaj jest kod może bardziej rozjaśni :
home.module.ts:

import { NgModule } from '@angular/core';
import { HomeRoutingModule, routedComponents } from './home-routing.module';
import { HomeComponent } from './components/home.component';
import { MaterialModule } from 'src/app/material.module';
import { CommonModule } from '@angular/common';
import { CategoryPopularComponent } from './containers/category-popular/category-popular.component';
import { ReactiveFormsModule } from '@angular/forms';

@NgModule({
  declarations: [CategoryPopularComponent, HomeComponent, routedComponents],
  imports: [HomeRoutingModule, MaterialModule, CommonModule, ReactiveFormsModule],
  exports: [],
  providers: []
})
export class HomeModule {}

Komponent do którego chce umieścić inny komponent:

<div class="container">
    <p>Najaktywniejsze kategorię</p>
    <app-category-popular class="popular"></app-category-popular>
</div>

a komponent który chciałbym umieścić jest pusty zawiera tylko tag

1

A pokaż jeszcze kod CategoryPopularComponent :)

0
Chramar napisał(a):

A pokaż jeszcze kod CategoryPopularComponent :)

Jasne :)
Html:

<p>Działa</p>

Ts:

import { Component, OnInit } from '@angular/core';
import { CategoryService } from 'src/app/core/api-services/category-api.service';
import { CategoryPopular } from 'src/app/models/category/category-popular';

@Component({
  selector: 'app-category-popular',
  templateUrl: './category-popular.component.html',
  styleUrls: ['./category-popular.component.scss']
})
export class CategoryPopularComponent implements OnInit {
  constructor(private categoryService: CategoryService) {}
  data: CategoryPopular[];
  ngOnInit() {
    console.log('JESTEM');
    this.categoryService.GetPopularCategory().subscribe(x => {
      this.data = x.payload;
    });
  }
}

1

Nie leci żaden błąd w konsoli podczas rendedlarowania strony? Czym się objawia "nic się nie dzieje"? Kompletnie nic? Co mówią narzędzia deweloperskie w kwestii DOMu?

1 użytkowników online, w tym zalogowanych: 0, gości: 1