Currently, I am in the process of developing an Angular 11 application that requires input for three distinct mailing addresses. Initially, I thought I had a clear understanding of what needed to be done, only to encounter warnings about elements with non-unique IDs. Following my failed attempt, I delved into Single Component Angular Modules and decided to experiment with a SCAM component on my reference application.
The runtime warnings I am facing are:
[DOM] Found 2 elements with non-unique id #Address2:
[DOM] Found 2 elements with non-unique id #Address1:
Below is a snippet of the concept address component I have been working on:
import { Component, OnInit, Input, Output, NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { CommonModule } from '@angular/common';
//
@Component({
selector: 'app-address',
template: `
<label for='Address1'>{{addressLabel}}</label>
...
...
In my app.component.html, you will find the following sections pertaining to the addresses:
...
<app-address
[disabled]='addressDisabled'
[addressLabel]='addressLabel_1'
[address1]='address1_1'
[address2]='address2_1'>
</app-address>
...
As for my app.module setup, it looks like this:
import { NgModule } from '@angular/core';
...
...
At this juncture, I am seeking the most effective solution to streamline the data entry process for multiple addresses within my application.