ngx-fi-moment
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

NgxFiMoment

moment as ngx-fi-moment

Installation

  • npm i moment --save
  • npm i ngx-fi-moment --save

How to use

In a module

import { NgModule } from "@angular/core";
import { NgxFiMomentModule } from "ngx-fi-moment";

@NgModule({
  imports: [NgxFiMomentModule], // for consumption within the scope of the module
  exports: [NgxFiMomentModule] // if propagation is required
})
export class SomeModule {}

Where required

import { Inject } from "@angular/core";
import { MomentDefinition, MOMENT_TOKEN } from "ngx-fi-moment";

export class SomeClass {
  constructor(@Inject(MOMENT_TOKEN) private moment: MomentDefinition) {}
}

For testing

import { NgxFiMomentModule } from "ngx-fi-moment";
import { MomentDefinition, MOMENT_TOKEN } from "ngx-fi-moment";

describe('TestingTitle', () => {
  let moment: MomentDefinition;
  beforeEach(async(() => {
      TestBed.configureTestingModule({
        imports: [NgxFiMomentModule]
      });

      moment = TestBed.get(MOMENT_TOKEN);
    }));
  }));
}));

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i ngx-fi-moment

    Weekly Downloads

    9

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    20.5 kB

    Total Files

    20

    Last publish

    Collaborators

    • fiakkasa