How to add MomentJS to an Aurelia application -


i've got app , i'm trying import momentjs use valueconverting. i've gone package.json file , added following jspm dependencies:

"moment": "npm:moment@^2.14.1" 

but when try import file, doesn't find module:

import moment '../moment'; 

i'm trying import in file that's 1 directory deep src folder. so, file in src/folder/file.ts

how import moment?

the thing should have import package add dependencies on package.json file , run build, correct?

you shouldn't manually editing package.json file unless absolutely necessary. should use jspm install moment moment installed. adding lines package.json file doesn't accomplish anything.

but you've added line package.json, , line added correct, need run jspm install code moment can pulled down , put in project.

next, import moment, you'll need this:

import moment 'moment'; 

now you'll have moment() function ready use in code.


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

http - Safari render HTML as received -