I am working with a large object in my component, where the properties of the object are connected to various components and inputs within the template:
constructor() {
this.data = {
identifier: null,
isRequired: true,
title: 'Untitled',
type: this.fileTypes[0].name,
description: '',
//more code here
}
<app-text-input [(model)]="data.title" label="Title" type="text" variant="white">
Due to all properties in data
being bound to different input elements, the values within the object remain up to date. Additionally, this component acts as a child component to another.
In order for the parent component to access the data
object when an event triggers (such as a button click), I am unsure of the best approach. While I am familiar with using @Outputs
, the events are occurring on the parent rather than the child. Furthermore, I have not yet implemented any FormControl classes - should I incorporate these to achieve the desired result?