import { NgModule} from '@angular/core';
export const my_custom_format{
var date_format=localStorage.getItem('date_format')
}
...
@NgModule({
  imports [
  ...
  ],
  declarations [
  ...
  ],
  entryComponents [
  ...
  ],
  providers [
  {provide: LOCALE_ID, useValue:date_format}
  ]
})
And when I come to page, my date_format gets the value from localStorage. But if my item in locaLstorage gets change, date_format is not updating. How to do that?