Angular-calendar: Template error 18

Created on 9 Mar 2018  路  1Comment  路  Source: mattlewis92/angular-calendar

I'm submitting a ...

[ X] Bug report 
[ ] Feature request
[ ] Support request => Please do not submit a support request here, please ask on https://stackoverflow.com/

Bug description / Feature request

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { CalendarModule } from 'angular-calendar';
import { NgbModalModule } from '@ng-bootstrap/ng-bootstrap';
import { DemoUtilsModule } from '../assets/demo-utils/module';

//routes

import { APP_ROUTING } from './app.routes';

//services
import { MenusService } from './services/menus.service';

//components

import { AppComponent } from './app.component';
import { MenuComponent } from './components/menu/menu.component';
import { NavbarComponent } from './components/navbar/navbar.component';
import { HomeComponent } from './components/home/home.component';
import { MenusComponent } from './components/menus/menus.component';
import { CalendarComponent } from './components/calendar/calendar.component';

@NgModule({
declarations: [
AppComponent,
MenuComponent,
NavbarComponent,
HomeComponent,
MenusComponent,
CalendarComponent
],
imports: [
CommonModule,
FormsModule,
NgbModalModule.forRoot(),
CalendarModule.forRoot(),
BrowserModule,
DemoUtilsModule,
APP_ROUTING
],
providers: [MenusService],
bootstrap: [AppComponent]
})
export class AppModule { }

Minimal reproduction of the problem with instructions


Whe i run the app show me the next error :

ERROR in src/assets/demo-utils/sources.ts(5,12): error TS2304: Cannot find name 'require'.
src/assets/demo-utils/sources.ts(6,20): error TS2304: Cannot find name 'require'.
src/assets/demo-utils/sources.ts(12,12): error TS2304: Cannot find name 'require'.
src/assets/demo-utils/sources.ts(13,20): error TS2304: Cannot find name 'require'.
src/assets/demo-utils/sources.ts(19,12): error TS2304: Cannot find name 'require'.
src/assets/demo-utils/sources.ts(20,20): error TS2304: Cannot find name 'require'.
src/assets/demo-utils/sources.ts(26,12): error TS2304: Cannot find name 'require'.
src/assets/demo-utils/sources.ts(27,20): error TS2304: Cannot find name 'require'.

Versions

Angular:

Angular CLI: 1.6.8
Node: 8.9.1
OS: win32 x64
Angular: 5.2.8
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.6.8
@angular-devkit/build-optimizer: 0.0.42
@angular-devkit/core: 0.0.29
@angular-devkit/schematics: 0.0.52
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.8
@schematics/angular: 0.1.17
typescript: 2.5.3
webpack: 3.10.0

Calendar library:
mattlewis92/angular-calendar

Browser name and version:

Google Chrome
Versi贸n 64.0.3282.186 (

>All comments

The demo components are not part of the official calendar. Why do you need to import the demo utilities?
If you remove the import of import { DemoUtilsModule } from '../assets/demo-utils/module'; and DemoUtilsModule from the module imports it will work.

Otherwise try installing the node typings (dev dependencies).
As mentioned in the issue template, please use stackoverflow for general questions.

Was this page helpful?
0 / 5 - 0 ratings