Skip to content

Angular 5 support #5

Open
Open

Description

@bou7mis

Hi, i upgraded my project to Angular 5 and since then I'm getting this error :
ERROR Error: Uncaught (in promise): TypeError: moment is not a function TypeError: moment is not a function at DateRangePickerWrapper.updateReactDateRangeFromNg (date-range-picker-wrapper.js:54) at DateRangePickerComponent.writeValue (date-range-picker.component.js:61) at eval (forms.js:2345) at eval (forms.js:3916) at Array.forEach (<anonymous>) at FormControl.setValue (forms.js:3916) at eval (forms.js:6203) at ZoneDelegate.invoke (zone.js:392) at Object.onInvoke (core.js:4629) at ZoneDelegate.invoke (zone.js:391) at DateRangePickerWrapper.updateReactDateRangeFromNg (date-range-picker-wrapper.js:54) at DateRangePickerComponent.writeValue (date-range-picker.component.js:61) at eval (forms.js:2345) at eval (forms.js:3916) at Array.forEach (<anonymous>) at FormControl.setValue (forms.js:3916) at eval (forms.js:6203) at ZoneDelegate.invoke (zone.js:392) at Object.onInvoke (core.js:4629) at ZoneDelegate.invoke (zone.js:391) at resolvePromise (zone.js:824) at eval (zone.js:876) at ZoneDelegate.invokeTask (zone.js:425) at Object.onInvokeTask (core.js:4620) at ZoneDelegate.invokeTask (zone.js:424) at Zone.runTask (zone.js:192) at drainMicroTaskQueue (zone.js:602) at ZoneTask.invokeTask [as invoke] (zone.js:503) at invokeTask (zone.js:1540) at HTMLButtonElement.globalZoneAwareCallback (zone.js:1566)

Here's my angular stack :
Angular CLI: 1.5.0
Node: 8.2.1
OS: darwin x64
Angular: 5.0.1
... animations, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic
... platform-server, router, service-worker

@angular/cdk: 5.0.0-rc0
@angular/cli: 1.5.0
@angular/material: 5.0.0-rc0
@angular-devkit/build-optimizer: 0.0.32
@angular-devkit/core: 0.0.20
@angular-devkit/schematics: 0.0.35
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.0
@schematics/angular: 0.1.0
typescript: 2.4.2
webpack: 3.8.1

I also get this warning from npm :
npm WARN angular-react-dates@0.1.5 requires a peer of @angular/core@>=2.0.0 <5.0.0 but none is installed. You must install peer dependencies yourself.

Other than that react-dates works fine apart from the fact that selected date range does not work even when i pass a valid value to ngModel.

Activity

  1. BenLayet commented on Mar 23, 2018

    @BenLayet

    Hi,
    Is there any update on angular 5 support ?
    Many thanks

  2. danielfliegauf commented on Apr 10, 2018

    @danielfliegauf

    I tried it today on a new cli project (angular 5.2.) and it works (complaining that it has an unmet peer-dependeny - but thats clear if you look at the package.json of this project.)

    try: import { FormsModule } from '@angular/forms';
    in your xxx.module.ts where you add the AngularReactDatesModule.forRoot().

    Hope that helps somebody :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions