import css to typescript angular code example
Example 1: change css to scss angular
ng config schematics.@schematics/angular:component.styleext scss
Example 2: typescript class import csv file
//
import csvData from './latlong.csv';
//
import textData from '../common/text/info.txt';
//
import jsonData from '../common/json/jsondata.json';
export const TextResource = textData; // not-work
export const JsonResource = <IJsondata> jsonData; // work
export const CsvResource = <ILatLong[]> csvData; // not-work
export interface IJsondata {
email: string;
password: string;
}
export interface ILatLong {
name: string;
lat: any;
long: any;
}
declare module "*.txt" {
const content: string;
export default content;
}
declare module '*.csv' {
const value: any;
export default value;
}