File
Implements
Metadata
changeDetection |
ChangeDetectionStrategy.OnPush |
selector |
div[body-text-top] |
styleUrls |
./body-text-top.component.scss |
templateUrl |
./body-text-top.component.html |
Index
Properties
|
|
Methods
|
|
Inputs
|
|
HostBindings
|
|
Public
columnOne
|
Type : any
|
|
Public
columnTwo
|
Type : any
|
|
Public
embeddedBodyEntities
|
|
import { Component, OnInit, Input, ChangeDetectionStrategy, HostBinding } from '@angular/core';
@Component({
selector: 'div[body-text-top]',
templateUrl: './body-text-top.component.html',
styleUrls: ['./body-text-top.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class BodyTextTopComponent implements OnInit {
@Input() entity;
public embeddedBodyEntities: [];
public columnOne: any;
public columnTwo: any;
@HostBinding('class') get class() { return 'col-md-8 space-between'; }
ngOnInit() {
this.embeddedBodyEntities = this.entity.EmbeddedBodytext;
this.columnOne = this.entity.ColumnOne;
this.columnTwo = this.entity.ColumnTwo;
}
}
<div class="body-text-top">
<ng-container *ngFor="let bodyTextEntity of embeddedBodyEntities">
<rich-text-field [textColor]="'white'" [body]="bodyTextEntity.BodyText"></rich-text-field>
</ng-container>
<div class="row">
<div *ngIf="columnOne" class="col-sm-6">
<rich-text-field [textColor]="'white'" [body]="columnOne"></rich-text-field>
</div>
<div *ngIf="columnTwo" class="col-sm-6">
<rich-text-field [textColor]="'white'" [body]="columnTwo"></rich-text-field>
</div>
</div>
</div>
@import "src/app/styles/helpers";
.body-text-top {
@include media-breakpoint-up(md) {
padding-bottom: 0;
}
@include media-breakpoint-up(md) {
& [class*="col-"]:last-child {
padding-left: calc-rem(15);
}
}
}
Legend
Html element with directive