Hello I have below function in angularjs which uses prototype inheritance.
function Conversation() {
this.currentBox = 1;
this.internalId = null;
this.subject = null;
this.unreadMessageCount = 0;
this.updateDate = new Date();
this.updatedBy = null;
this.messages = [];
this.participants = {};
this.isComplete = false;
}
Conversation.prototype.setupFromConversation = function (conversation) {
this.currentBox = conversation.currentBox || null;
this.internalId = conversation.internalId || null;
this.subject = conversation.subject || null;
this.unreadMessageCount = conversation.unreadMessageCount || null;
this.updateDate = conversation.updateDate || null;
this.updatedBy = conversation.updatedBy.toLowerCase() || null;
this.messages = conversation.messages || [];
this.participants = {};
this.addParticipants(conversation.participants);
}
I want to have function in angular 6 application, please remember that this is seperate file in angularjs application and I would like to have same thing where I can use this function in angular 6 application.