javascript - 无法解析 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
}
}
解决方案
推荐阅读
- javascript - 如何修复对象数组中对象的属性?
- reactjs - 如何将回历添加到 FullCalendar
- r - 基于字符串匹配和分号分隔字段
- domain-driven-design - 事件风暴和读取事件
- javascript - mathjax-node 中的 Mhchem 无法正确呈现复杂的公式
- api - 即使从具有白名单 ip 的服务器也无法访问 sfc api
- apache-spark - 使用 pyspark 从 AWS Glue 中的 DataFrames 创建列表的最快方法
- css - 浏览器标头和操作系统标头的高度
- python - 将静态方法的输出分配给 Python 中的静态变量
- java - 逐行读取并插入数据(16 GB JSON)太慢(MySQL + JAVA spring boot)