Question: Suppose we have an array declared in an Angular component as follows: colours: string[]; Using the *ngFor attribute, how would we code a set of

  1. Suppose we have an array declared in an Angular component as follows:

colours: string[];

Using the *ngFor attribute, how would we code a set of paragraphs in the template (using

tags) of the form:

Colour 1 is red

Colour 2 is yellow

Colour 3 is pink

This assumes the array is initialised with the strings red, yellow, pink, etc. (5 marks).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!