What is the interface type format in the angular cli?
Like so :
interface GraphDatas {
firstTemperature: Period
internalTemperature: {
min: number;
max: number;
};
secondTemperature: Period;
thresholdAlerts: Threshold;
}
interface Period {
currentPeriod: number;
previousPeriod: any; // TO DO
}
interface Threshold extends Period {
hasBeenRead: number;
}
You will need to export the interface you want to use in your typescript file after that :
export interface test{
listComputedDatas: GraphDatas;
}
And in your code :
import {test} from './pathToInterface';
...
randomProperty: test;
// Typescript should detect properties such as
// randomProperty.listComputedDatas.internalTemperature.min
EDIT : You will be faster creating your own file manually than doing the angular-cli
command...
ng generate will generate
filename <name>.<type>.ts
content:
export interface <name> { //camel case
}
ie
ng generate interface Itest sometype
generates
file name itest.sometype.ts
content
export interface Itest {
}
Using Angular CLI
,
ng g i filename
will create a file by the name filename.ts
and
will have export interface filename {}
in it