I am a beginner when it comes to Angular and I have a question regarding setting positions of an array that is initially declared as empty in one component, using its selector in another component.
Let's take for example a component named "array" where the array is declared as empty in the array.component.ts file:
export class ArrayComponent {
array: number[] = [];
}
In my main "app" component, I want to utilize the "array" component and assign values to it using its selector:
app.component.html:
<app-array array="10"></app-array>
Is this scenario possible? And if so, what would be the best approach to implement it? Would Attribute directives be suitable for this task?
Any guidance on how to achieve this would be greatly appreciated.
I haven't attempted any solutions yet as I'm unsure about the exact implementation process.