I've been working on refactoring some code that contains a significant amount of duplicate methods between two components. Component A is a child of component B, and they can be separate instances as intended. The issue I'm facing revolves around emitting data within certain methods, and then struggling to pass those inputs to the template for reasons unknown.
Here's an overview of my current setup:
Both component A and component B are emitting events, and I haven't altered these methods yet because it's difficult to separate that logic. How can I make adjustments to the inputs on the service side and reflect those changes in the component? Any insights or guidance on this?
component A
export class CompA {
template: ...
...
inputs [
'value1'
'value2'
]
outputs: [
'doSomething'
'doSomething2'
'doSomething3'
]
public value1: string;
public value2: string
addLine() {
//simple example
if(this.value1 == ""){
this.doSomething1.emit(3)
// the functions are obviously bigger but i need this emit inside the service and catch the event in the component
}
}