DEV Community

tlink9252
tlink9252

Posted on

1

Angular 10 with PRIMENG DROP DOWNS Not binding saved data

Here are my models they come down from the api fine, the problem is not when I change the drop down and save that part if fine the issue is when the page loads all the drop downs are at their default

export interface LookUpData {
Id: number;
Display: string;
Description: string;
Value: string;
}

export interface RiskQuestionaireData {
RiskId: number;
OrgId: number;
QuestionDetail: QuestionDetail[];
}

export interface QuestionDetail {
Id: number;
Category: string;
Question: string;
InherentId?: number;
CurrentId?: number;
ResidualId?: number;
LookUpData: LookUpData[];
AnswerListText: string;
InherentConsequence:LookUpData;
CurrentConsequence:LookUpData;
ResidualConsequence:LookUpData;
}

here is the ngTemplate i use
for ngModel is have tried [(ngModel)]="questionDataObject.QuestionDetail[rowIndex].InherentId" as well as [(ngModel)]="questionDataObject.QuestionDetail[rowIndex].InherentConsequence

          <td colspan="2" [pEditableColumn]="rowData">
            <p-dropdown [options]="getddlList(rowData)" optionLabel="Display"    optionValue ="Id"
              [(ngModel)]="questionDataObject.QuestionDetail[rowIndex].InherentId" name="inherent">
            </p-dropdown>
          </td>


        </tr>
      </ng-template>

angular
primeng
angular2-template
prime

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

Cloudinary image

Video API: manage, encode, and optimize for any device, channel or network condition. Deliver branded video experiences in minutes and get deep engagement insights.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay