Encountering a problem while attempting to create a property for the model class within my angular controller using the constructor. Take a look at my code below:
app.ts
module app {
angular
.module("formApp", [
"ngMaterial",
"ngMdIcons",
"ngMessages"
]);
}
model.ts
module app.model {
export interface IPatient {
firstName: string;
lastName: string;
gender: string;
birthDate: Date;
currentMedications: string;
notes: string;
isMedicare: boolean;
medicareName: string;
medications: string[];
ethnicity: string[];
}
export class Patient implements IPatient {
constructor(
public firstName: string,
public lastName: string,
public gender: string,
public birthDate: Date,
public currentMedications: string,
public notes: string,
public isMedicare: boolean,
public medicareName: string,
public medications: string[],
public ethnicity: string[]
) {
}
}
}
controller.ts
module app.main {
class MainController {
constructor(public patient: app.model.IPatient) {
}
}
angular
.module("formApp")
.controller("MainController", MainController);
}
Struggling to initialize the patient property through the constructor, resulting in an error when running the application.