File
Implements
Metadata
changeDetection |
ChangeDetectionStrategy.OnPush |
selector |
div[body-text-main] |
styleUrls |
./body-text-main.component.scss |
templateUrl |
./body-text-main.component.html |
Index
Properties
|
|
Methods
|
|
Inputs
|
|
HostBindings
|
|
Public
embeddedBodyEntities
|
|
import { Component, OnInit, Input, ChangeDetectionStrategy, HostBinding, ChangeDetectorRef } from '@angular/core';
@Component({
selector: 'div[body-text-main]',
templateUrl: './body-text-main.component.html',
styleUrls: ['./body-text-main.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class BodyTextMainComponent implements OnInit {
@Input() entity;
public embeddedBodyEntities: [];
@HostBinding('class') get class() { return 'col-md-8 space-between'; }
constructor() { }
ngOnInit() {
this.embeddedBodyEntities = this.entity.EmbeddedBodytext;
}
}
<div class="body-text-main">
<div class="body">
<ng-container *ngFor="let bodyTextEntity of embeddedBodyEntities">
<rich-text-field [body]="bodyTextEntity.BodyText"></rich-text-field>
</ng-container>
</div>
<div *ngIf="entity.Footnote?.length > 0" class="footer">
<ol>
<li class="d-flex" *ngFor="let footnote of entity.Footnote; let i=index">
<span class="mr-1"><sup>{{i+1}})</sup></span>
<rich-text-field [body]="footnote"></rich-text-field>
</li>
</ol>
</div>
</div>
@import "src/app/styles/helpers";
.body-text-main {
.footer {
border-top: 1px solid $light-slate;
padding-top: calc-rem(20);
@include font-size(12);
ol {
padding-left: 0;
list-style: none;
}
}
}
Legend
Html element with directive