As I declare an attribute of type Date in Typescript (Angular 6)

2

I am using NodeJS + Angular6 to make a web application and I have a model called "Employee". My problem is that I have a file called "empleadoModel.ts" that has the code:

//Importamos el archivo que necesitamos
import { tipoEmpleadoModel } from './tipoEmpleadoModel';
import { ciudadModel } from './ciudadModel';

/**
 * Entidad empleado
 */
export class Empleado {

    cedula: string;
    nombre: string;
    apellido: string;
    fecha_nacimiento: date;
    fecha_ingreso: date;
    genero: string;
    direccion: string;
    salario: number;
    ciudad: ciudadModel;
    telefono: string;
    entevistaAceptada: boolean;
    email: string;
    tipoEmpleado: tipoEmpleadoModel;

}

But when I run the project, the following error occurs:

Cannot find name 'date'.
    
asked by Sebastian Salazar 19.09.2018 в 03:52
source

1 answer

3

Use Date in the properties of your class.

fecha_nacimiento: Date;
fecha_ingreso: Date;
    
answered by 19.09.2018 / 04:54
source