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

Tiugo image

Modular, Fast, and Built for Developers

CKEditor 5 gives you full control over your editing experience. A modular architecture means you get high performance, fewer re-renders and a setup that scales with your needs.

Start now

Top comments (0)

ACI image

ACI.dev: The Only MCP Server Your AI Agents Need

ACI.dev’s open-source tool-use platform and Unified MCP Server turns 600+ functions into two simple MCP tools on one server—search and execute. Comes with multi-tenant auth and natural-language permission scopes. 100% open-source under Apache 2.0.

Star our GitHub!

👋 Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay