Нашёл, куда на самом деле импорт необходимо делать.
В app.components.ts
import { Component, NgModule, inject } from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { ProfileCardComponent } from "./common-ui/profile-card/profile-card.component";
import { ProfileService } from './data/services/profile.service'
import {JsonPipe } from '@angular/common';
@Component({
selector: 'app-root',
standalone: true,
templateUrl: './app.component.html',
styleUrl: './app.component.scss',
imports: [RouterOutlet, ProfileCardComponent, JsonPipe] //вот здесь
})
export class AppComponent {
profileService = inject(ProfileService)
profiles: any = []
constructor(){
this.profileService.getTestAccounts().
subscribe(value => {
this.profiles = value
})
}
}