Failed to execute 'setAttribute' on 'Element': ']' is not a valid attribute name. angular 4

[(ngModel)]="model.description"] // ']' is added unnecessarily

change it to

[(ngModel)]="model.description"

Don't wrap it to a square bracket.

Update:

You can initialize your model variable as follow according to your need,

model:ModalComponentModel=<ModalComponentModel>{};

OR

model:ModalComponentModel=<ModalComponentModel>[];

Problem is in this line

Change

From

  <textarea rows="4" cols="50" placeholder="Description" [(ngModel)]="model.description"]></textarea>

to

  <textarea rows="4" cols="50" placeholder="Description" [(ngModel)]="model.description"></textarea>

You have problem in this line of code:

<textarea rows="4" cols="50" placeholder="Description" [(ngModel)]="model.description"]></textarea>

It should be:

<textarea rows="4" cols="50" placeholder="Description" [(ngModel)]="model.description"></textarea>

There is an extra bracket that is causing this error.

Tags:

Angular