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],
exports: [NgxFiMomentModule]
})
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);
}));
}));
}));