# \[Solved\] How to get momentJS into a ionic2 TS project without errors?

**URL:** <https://forum.ionicframework.com/t/solved-how-to-get-momentjs-into-a-ionic2-ts-project-without-errors/46862>\
**Category:** ionic-v3\
**Created:** [March 19, 2016, 3:09am UTC](https://forum.ionicframework.com/t/solved-how-to-get-momentjs-into-a-ionic2-ts-project-without-errors/46862 "2016-03-19T03:09:25Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![rapropos](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rapropos/32/100227_2.png) [@rapropos](https://forum.ionicframework.com/u/rapropos)\
**Post date:** [March 19, 2016, 4:22am UTC](https://forum.ionicframework.com/t/solved-how-to-get-momentjs-into-a-ionic2-ts-project-without-errors/46862/3 "2016-03-19T04:22:10Z")

</div>

There shouldn’t be any need to install it as ambient. moment has typings in the registry.

```auto
$ npm install --save moment
$ typings install --save moment

```

in `tsconfig.json`:

```auto
"files": [
    "typings/main.d.ts",
   ...
]

```

when needed:

```auto
import * as moment from 'moment';
export class Foo {
  bar(instant:moment.Moment):void {
   // do things
  }
}

```

---

_[View the full topic](https://forum.ionicframework.com/t/solved-how-to-get-momentjs-into-a-ionic2-ts-project-without-errors/46862)._
