반응형

angular 4

NgModule.schema에 CUSTOM_ELELENTS_SCHEMA가 추가되었지만 여전히 오류가 표시됨

NgModule.schema에 CUSTOM_ELELENTS_SCHEMA가 추가되었지만 여전히 오류가 표시됨 방금 Angular 2 rc4에서 rc6로 업그레이드했는데 문제가 있습니다. 콘솔에 다음 오류가 표시됩니다. Unhandled Promise rejection: Template parse errors: 'cl-header' is not a known element: 1. If 'cl-header' is an Angular component, then verify that it is part of this module. 2. If 'cl-header' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schema' of th..

source 2023.04.27

'app/hero.ts' 파일은 콘솔의 모듈 오류가 아닙니다. angular2의 디렉토리 구조에서 인터페이스 파일을 저장할 위치는 어디입니까?

'app/hero.ts' 파일은 콘솔의 모듈 오류가 아닙니다. angular2의 디렉토리 구조에서 인터페이스 파일을 저장할 위치는 어디입니까? 나는 하고 있습니다.angular2다음 주소에서 튜토리얼: https://angular.io/docs/ts/latest/tutorial/toh-pt3.html 나는 그것을 넣었습니다.hero인터페이스를 단일 파일 아래에 설치합니다.app콘솔에서 다음 오류가 발생했습니다. app/app.component.ts(2,20): error TS2306: File 'app/hero.ts' is not a module. [0] app/hero-detail.component.ts(2,20): error TS2306: File 'app/hero.ts' is not a module..

source 2023.04.27

TemplateRef!(NgIf ->TemplateRef) 제공자가 없습니다.

TemplateRef!(NgIf ->TemplateRef) 제공자가 없습니다. 응답이 허용된 경우 체크 표시를 표시하려고 합니다. template: `✔` 하지만 다음과 같은 오류가 발생합니다. EXCEPTION: No provider for TemplateRef! (NgIf ->TemplateRef) 내가 뭘 잘못하고 있는 거지?당신은 그것을 놓쳤습니다.*NgIf 앞에서 (우리 모두가 수십 번 그랬던 것처럼): ✔ 다음을 제외하고는*Angular는 그것을 봅니다.ngIf지시가 적용되고 있습니다.div요소, 하지만 없기 때문에.*또는태그. 템플릿을 찾을 수 없으므로 오류가 발생했습니다. Angular v5에서 이 오류가 발생하는 경우: 오류: 정적 인젝터 오류[TemplateRef]: 정적 인젝터 오류 ..

source 2023.04.27

ngFor와 함께 trackBy를 사용하는 방법

ngFor와 함께 trackBy를 사용하는 방법 저는 제가 무엇을 반환해야 하는지 정말 이해할 수 없습니다.trackBy웹에서 본 몇 가지 예를 바탕으로 객체에 대한 일부 속성 값을 반환해야 합니다.맞나요?내가 받아야 하는 이유index매개 변수로? 예를 들어, 다음과 같은 경우: Component.component.ts constructor() { window.setInterval(() => this.users = [ { name: 'user1', score: Math.random() }, { name: 'user2', score: Math.random() } ], 1000); } userByName(index, user) { return user.name; } Component.template.htm..

source 2023.04.27
반응형