خرید بک لینک

Vote count: 0

I am getting very confused with regards to importing a Typings file, there seems to be so many ways to do it.

I am writing a nodejs program.

I installed momentJS via typings (not an ambient module) and I have manged to import it like so

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

import * as testTwo from 'moment';

import * as testThree from 'moment/moment';

It seems all three ways are working. 1st option is the original node require way I am used to... the other 2 seem to be a typescript import.

I have used a single moment directory structure and moment/moment and they seem to equally work.

I am ignoring typings/browser...

So my directory structure for the moment is actually stored here

     /typings/main/definitions/moment/index.d.ts

So should i be using moment or moment/moment ?

I did try checking the docs and I dont know if i am just not understanding it correctly but which import do I use when ?

And with regards to typings ??

I hope someone can help because right now I just seem to be going round in circles.

The typings command I used to install momentjs was

    typings install moment

Thanks in advance

asked 2 mins ago

برچسب: نویسنده: استخدام کار تاريخ: شنبه 21 فروردين 1395 ساعت: 2:58

صفحه بندی