gpt4 book ai didi

angular - 类型错误 : Cannot read property 'toString' of undefined Angular 6

转载 作者:太空狗 更新时间:2023-10-29 18:03:14 25 4
gpt4 key购买 nike

我正在尝试使用 angular 6 构建一个库,但我遇到了一些问题。

在将 --SoumissionStructComponent-- 添加到我的库模块之前没有发生任何错误

但是一旦我添加它,我就得到了这个

TypeError: Cannot read property 'toString' of undefined
at new Input (C:\Users\taha.manar\Documents\workspace\Adjucation-Ihm\node_modules\ng-packagr\node_modules\postcss\lib\input.js:53:20)
at parse (C:\Users\taha.manar\Documents\workspace\Adjucation-Ihm\node_modules\ng-packagr\node_modules\postcss\lib\parse.js:13:15)
at new LazyResult (C:\Users\taha.manar\Documents\workspace\Adjucation-Ihm\node_modules\ng-packagr\node_modules\postcss\lib\lazy-result.js:60:16)
at Processor.<anonymous> (C:\Users\taha.manar\Documents\workspace\Adjucation-Ihm\node_modules\ng-packagr\node_modules\postcss\lib\processor.js:138:12)
...

SoumissionStructComponent.ts

import { Component, OnInit } from '@angular/core';
import { SoumissionService } from './soumission.service';
import { ListElements, ElementList } from './../Common/root-page/model/ElementList';

@Component({
selector: 'app-soumission-struct',
templateUrl: './soumission-struct.component.html',
styleUrls: ['./soumission-struct.component.css']
})
export class SoumissionStructComponent implements OnInit {
listElements: ListElements;
elementsList: ElementList[] = [];
constructor(private soumissionService: SoumissionService) {
soumissionService.getActivatedSoumission().subscribe((r: any) => {

this.listElements = new ListElements();
this.listElements.listElts = [];
if (r) {
this.listElements.listElts.push({ key: r.id, value: r.seanceDate });
}
});
}

ngOnInit() {
}

}

希望我已经把问题描述清楚了

最佳答案

ng generate 之后,你是否更改了你的 css -> scss?如果是这样,那么您需要更新 styleUrls

关于angular - 类型错误 : Cannot read property 'toString' of undefined Angular 6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53086412/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com