description |
---|
A List component contains List Item components in the form of line items. |
List component contains a number of List Item components.There is no requirement to set the number of columns. It is an unordered list, and the list items will come one below the other.
- Drag and drop a List component.
- Set the attribute such as style and class.
- Insert one or more List Items component inside the List component.
Display a list of three items:
- Drag and drop a List component and set the attribute such as
style
andclass
. - Drag and drop a List Item component inside the List component, and set the attributes of the List Item component_._
ngFor
is used to iterate through the object and access the items of the objects, if folders is an object which has attribute as name(name of folder) as a string type, with three items in the folder object, set the field inngFor
as let folder of folders.Label
attribute displays the name as list items, provide the name asfolder.name
, this will access the folders object and get the name value. If the folders object contains three values such as photos, work and document, then the list items will be photos, work and document.- Save and run the page. A list with three items will be displayed.
-
**
List label:
**Used to put a display text on the component describing what purpose it has for the user. -
style
: Accepts a string value that affects different properties of the List such as height, width, and color, based on the values provided. For example:background:orange:height:200px
. -
class
: Used to point to a class in a style sheet. Each class contains one or more style statements defined in the Style editor. TheClass
field accepts space separated class names such asclass1 class2
, where each class is defined in the Style editor as shown below:.class1 { border-radius:10px; flex-basis:10%; height:100px; } .class2 { border-radius:10px; flex-basis:10%; height:100px; }
Support
- Devices: Android, iOS
- Browsers: Latest version of all modern browsers
- Dependencies version:
- Angular CLI version: 6.0.0 +
- Cordova version: 7.1.0 +