首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >角度6误差..。calendar.component没有导出成员“CalendarComponent”

角度6误差..。calendar.component没有导出成员“CalendarComponent”
EN

Stack Overflow用户
提问于 2018-11-09 16:13:48
回答 1查看 1.2K关注 0票数 0

我在这里报告一个问题,希望一些虔诚的灵魂能帮上忙。问题是,Node给了我一个错误:

src/app/app.module.ts中的错误(11,10):ERROR TS2305:模块TS2305没有导出成员‘Cal宪兵组件’。src/app/components/calendar/calendar.component.ts(27,3):error TS2390:缺少构造函数实现。src/app/components/oculus/oculus.component.ts(2,34):error TS2307:无法找到模块“组件/日历/日历组件”。src/app/components/top-menu/top-menu.component.ts(2,10):error TS2305:模块'"V:/Projects/Kompany/source/kompany-war/src/main/websrc/test2/test-kompany/src/app/components/calendar/calendar.component"‘没有导出成员'CalendarComponent’。

这是地点..。

我在应用模块上有这个..。

代码语言:javascript
复制
 `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

这是我下载图书馆的地方。

我是新的角度,所以我提供了所有的信息,希望不要是无聊的。

到日历里是什么.

代码语言:javascript
复制
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的基础设施造成的。和一些类似的主题的答案,关于订购进口,但他们已经是有序的。

我真的不知道该怎么办..。希望有人能帮上忙。

满面笑容

EN

回答 1

Stack Overflow用户

发布于 2018-11-09 20:58:58

我看到了一些错误,所有的角度都在抱怨。

  1. 在您列出的文件中没有名为“CalendarComponent”的导出类--在该文件中,您导出一个名为“DemoComponent”的类。
  2. 在component.ts文件的第27行中,您没有构造函数的定义。您有constructor (),但是如果您希望它是空的,则应该使用constructor() {}
  3. 看起来,您还试图在另外两个组件中导入错误命名的类,即“oculus.Component.ts”和“top-menu.Component.ts”
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53229421

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档