ngx-mask-fixed
Version:
awesome ngx mask
55 lines (54 loc) • 1.8 kB
JavaScript
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
import { NgModule } from '@angular/core';
import { config, INITIAL_CONFIG, initialConfig, NEW_CONFIG } from './config';
import { MaskApplierService } from './mask-applier.service';
import { MaskDirective } from './mask.directive';
import { MaskPipe } from './mask.pipe';
var NgxMaskModule = (function () {
function NgxMaskModule() {
}
NgxMaskModule.forRoot = function (configValue) {
return {
ngModule: NgxMaskModule,
providers: [
{
provide: NEW_CONFIG,
useValue: configValue
},
{
provide: INITIAL_CONFIG,
useValue: initialConfig
},
{
provide: config,
useFactory: _configFactory,
deps: [INITIAL_CONFIG, NEW_CONFIG]
},
]
};
};
NgxMaskModule.decorators = [
{ type: NgModule, args: [{
providers: [MaskApplierService],
exports: [MaskDirective, MaskPipe],
declarations: [MaskDirective, MaskPipe]
},] },
];
/** @nocollapse */
NgxMaskModule.ctorParameters = function () { return []; };
return NgxMaskModule;
}());
export { NgxMaskModule };
/**
* @internal
*/
export function _configFactory(initConfig, configValue) {
return (typeof configValue === 'function') ? configValue() : __assign({}, initConfig, configValue);
}