Hi,
I would like to add moment-timer plugin (https://github.com/SeverinDK/moment-timer) to my project
where i using moment.js.
I installed plugin moment-timer in path
’…\project_name\node_modules\moment’ with npm (npm install moment-timer -save) where is placed package.json file for moment.js.
Dependencie was added correctly.
Basic version of moment.js works fine.
But when i try to use basic moment-timer function, for example:
var timer = moment.duration(5, "seconds").timer(function() {
// Callback
});
i get error “Property ‘timer’ does not exist on type ‘Duration’”.
It seems that environment can’t ‘see’ moment-timer plugin.
Should i add some extra import (i’m using “import * as moment from ‘moment’;” for moment.js)?
I tried add “import ‘moment-timer’;” but didn’t work.
Any tips?