How to use moment.js library in angular 2 typescript app? -


i tried use typescript bindings:

npm install moment --save typings install moment --ambient -- save 

test.ts:

import {moment} 'moment/moment'; 

and without:

npm install moment --save 

test.ts:

var moment = require('moment/moment'); 

but when call moment.format(), error. should simple, can provide command line/import combination work?

we're using modules now, try import {momentmodule} 'angular2-moment/module'; after npm install angular2-moment.. http://ngmodules.org/modules/angular2-moment


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -