File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 1
1
export class ListTemplate {
2
+ // html unordered list element
2
3
constructor ( container ) {
3
4
this . container = container ;
4
5
}
Original file line number Diff line number Diff line change 1
1
import { HasFormatter } from "../interfaces/HasFormatter" ;
2
2
3
3
export class ListTemplate {
4
- constructor ( private container : HTMLUListElement ) { }
4
+ // html unordered list element
5
+ constructor ( private container : HTMLUListElement ) { }
5
6
6
- render ( item : HasFormatter , heading : string , pos : 'start' | 'end' ) {
7
+ render ( item : HasFormatter , heading : string , pos : 'start' | 'end' ) {
7
8
const li = document . createElement ( 'li' ) ;
8
-
9
+
9
10
const h4 = document . createElement ( 'h4' ) ;
10
11
h4 . innerText = heading ;
11
12
li . append ( h4 ) ;
@@ -14,7 +15,7 @@ export class ListTemplate {
14
15
p . innerText = item . format ( ) ;
15
16
li . append ( p ) ;
16
17
17
- if ( pos === 'start' ) {
18
+ if ( pos === 'start' ) {
18
19
this . container . prepend ( li ) ;
19
20
} else {
20
21
this . container . append ( li ) ;
You can’t perform that action at this time.
0 commit comments