首页 > 解决方案 > 无法解析 HomeInnerComponent Angular 7 的所有参数

问题描述

尝试运行 Angular 应用程序时,我的控制台中出现以下错误。如果您需要,这是我的 html 代码https://stackblitz.com/edit/angular-xrbrjq?file=src%2Fapp%2Fapp.component.html

错误:无法解析 HomeInnerComponent 的所有参数:(?)。

请在下面查看我的组件详细信息。

主页-inner.component.ts:

import { Component, OnInit } from '@angular/core';
import {CategoriesService } from '../../Admin/categories/categories.service';
import {Categories } from '../../Admin/categories/categories';

@Component({
  selector: 'app-home-inner',
  templateUrl: './home-inner.component.html',
  styleUrls: ['./home-inner.component.css']
})
export class HomeInnerComponent implements OnInit {
  leftCat:Categories;
  constructor(private leftCategoriesService: CategoriesService) { }

  ngOnInit() {

    // For showing category list in the left side

    this.leftCategoriesService.getCategories()
    .subscribe((data: any) => {
      this.leftCat = data;
      //console.log(this.leftCat);
      // localStorage.removeItem('editEmpId');
    });

// Left side category list ends here

  }
}

在此处输入图像描述

标签: javascripthtmlcssangular

解决方案


推荐阅读