[英]Angular 6 Error… calendar.component has no exported member 'CalendarComponent'
我在這里報告一個問題,希望一些虔誠的人能為您提供幫助。這是問題所在,Node給我這個錯誤:
src / app / app.module.ts(11,10)中的錯誤:錯誤TS2305:模塊'“ V:/ Projects / Kompany / source / kompany-war / src / main / websrc / test2 / test-kompany / src / app / components / calendar / calendar.component“'沒有導出的成員'CalendarComponent'。 src / app / components / calendar / calendar.component.ts(27,3):錯誤TS2390:構造函數實現丟失。 src / app / components / oculus / oculus.component.ts(2,34):錯誤TS2307:找不到模塊'components / calendar / calendar.component'。 src / app / components / top-menu / top-menu.component.ts(2,10):錯誤TS2305:模塊'“ V:/ Projects / Kompany / source / kompany-war / src / main / websrc / test2 / test-kompany / src / app / components / calendar / calendar.component“'沒有導出的成員'CalendarComponent'。
這是情景。
我在應用程序模塊上有這個...
`import { BrowserModule } from '@angular/platform-browser';`
`import { NgModule } from '@angular/core';`
`import { CalendarModule, DateAdapter } from 'angular-calendar';`
`import { adapterFactory } from 'angular-calendar/date-adapters/date-fns';`
import { CalendarComponent } from'./components/calendar/calendar.component';
我正在嘗試將日歷庫放入我的網站。
錯誤出在我創建的組件(“日歷組件”)上,然后將在網上找到的所有信息都放在該組件上以進行嘗試。
https://mattlewis92.github.io/angular-calendar/docs/index.html
這是我下載庫的地方。
我是Angular的新手,所以我會提供我所擁有的所有信息,希望不要感到無聊。
進入壓延組件中就是這里...
import { Component, ChangeDetectionStrategy, OnInit } from '@angular/core';
import { CalendarEvent } from 'angular-calendar';
@Component({
selector: 'app-calendar',
changeDetection: ChangeDetectionStrategy.OnPush,
templateUrl: './calendar.component.html'
})
export class DemoComponent {
view: string = 'month';
viewDate: Date = new Date();
events: CalendarEvent[] = [
{
title: 'Click me',
start: new Date()
},
{
title: 'Or click me',
start: new Date()
}
];
constructor ()
ngOnInit() {
}
eventClicked({ event }: { event: CalendarEvent }): void {
console.log('Event clicked', event);
}
}
我在網站上讀到,此錯誤是由於我得到的Angular的基礎結構引起的。還有一些有關訂購進口的類似主題的答案,但它們已經有序。
我真的不知道該怎么辦..希望有人會有所幫助..
很多笑容
我看到了許多錯誤,所有這些都是角度的抱怨。
constructor ()
但如果希望它為空,則應該具有constructor() {}
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.