aurelia / documentation

The documentation for Aurelia.
MIT License
105 stars 110 forks source link

Demos not working on certain Aurelia Hub routes #309

Closed deviprsd closed 7 years ago

deviprsd commented 7 years ago

The demos of this page Converters is not working.

Console shows this error

Unhandled rejection TypeError: moment is not a function
    at DateFormatValueConverter.toView (https://cdn.rawgit.com/aurelia/binding/1.0.9/doc/example-dist/binding-value-converters/simple-converter/date-format.js:40:14)
    at t.e.ValueConverter.t.evaluate (http://aurelia.io/scripts/vendor-bundle.js:6:20979)
    at e.ChildInterpolationBinding.e.bind (http://aurelia.io/scripts/vendor-bundle.js:14:23552)
    at e.View.e.bind (http://aurelia.io/scripts/vendor-bundle.js:13:7799)
    at e.Controller.e.bind (http://aurelia.io/scripts/vendor-bundle.js:13:29578)
    at e.Controller.e.automate (http://aurelia.io/scripts/vendor-bundle.js:13:28838)
    at http://aurelia.io/scripts/vendor-bundle.js:14:10133
AStoker commented 7 years ago

Make sure you have moment installed with npm, and that you've defined it as a dependency in your vendor bundle.

deviprsd commented 7 years ago

No this is a bug in aurelia.io, I'm reporting it http://aurelia.io/hub.html#/doc/article/aurelia/binding/latest/binding-value-converters/3

AStoker commented 7 years ago

Oops! My bad, yup, that's broke all right 😄

deviprsd commented 7 years ago

Moment is included in the file, why is there an error then?

AStoker commented 7 years ago

Moment seems to be the Moment instance, not a function

deviprsd commented 7 years ago

The official docs suggest this

import * as moment from 'moment';

let now = moment().format('LLLL');
AStoker commented 7 years ago

Somebody is on it, they've got a backlog of things to do over the weekend, and this is one of them.

deviprsd commented 7 years ago

Okay 👍

jdanyow commented 7 years ago

https://github.com/aurelia/binding/issues/504