I am trying to access mock JSON data from data.mock.ts file into ‘data.stories.ts’ file. I tried writing some code in getWindowsData function which is in stories file but I am unable to access the data
Here is my code for data.mock.ts file
export class Windows {
public static readonly Windows = {
Windows: [
{
WindowsValue: 993,
WindowsYear: 1997,
},
{
WindowsValue: 953,
WindowsYear: 1873,
},
],
};
}
Here is my code for data.stories.ts file
export function HttpLoaderFactory(https: https) {
return new TranslateHttpLoader(https, './i18n/', '.json');
}
@NgModule()
export class WindowsStoriesComponent {
constructor(private translate: TranslateService, private localeService: LocaleService) {
localeService.nameObservable().subscribe((name) => {
translate.use(name);
});
}
}
},
};
});
How can I get the data from mock file to stories file?