-
Notifications
You must be signed in to change notification settings - Fork 12k
Closed
Description
Please provide us with the following information:
- OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
Ubuntu 14.04 - Versions. Please run
ng --version
. If there's nothing outputted, please run
in a Terminal:node --version
and paste the result here:
angular-cli: 1.0.0-beta.11-webpack.8
node: 6.3.1
os: linux x64
- Repro steps. Was this an app that wasn't created using the CLI? What change did you
do on your code? etc.
This is a project done from the start with angular cli.
- Install moment:
npm install moment --save
typings install dt~moment --global --save
Include in ts file:
import * as moment from 'moment'
and call any method:
moment().calendar()
- The log given by the failure. Normally this include a stack trace and some
more information.
offers.service.ts:21 __WEBPACK_IMPORTED_MODULE_4_moment__ is not a function
OffersService.handleError @ offers.service.ts:21
ZoneDelegate.invoke @ zone.js:323
NgZoneImpl.inner.inner.fork.onInvoke @ ng_zone_impl.js:53
ZoneDelegate.invoke @ zone.js:322
Zone.run @ zone.js:216
(anonymous function) @ zone.js:571
ZoneDelegate.invokeTask @ zone.js:356
NgZoneImpl.inner.inner.fork.onInvokeTask @ ng_zone_impl.js:44
ZoneDelegate.invokeTask @ zone.js:355
Zone.runTask @ zone.js:256
drainMicroTaskQueue @ zone.js:474
ZoneTask.invoke @ zone.js:426
- Mention any other details that might be useful.
If I leave import * as moment from 'moment'
in the component, the component wont run at all. If I remove it, the component works properly but I get client?93b6:49 [default] /home/alejo/projects/ng-backend/src/app/services/offers/offers.service.ts:37:31 Cannot find name 'moment'.
when serving the app.
Thanks! We'll be in touch soon.
Metadata
Metadata
Assignees
Labels
No labels