Skip to content

Commit

Permalink
Toolbar/Adaptability/Angular (cherry picked from commit 99045d5)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpreyskurantov committed Oct 16, 2024
1 parent 1529899 commit c66b59e
Showing 1 changed file with 15 additions and 22 deletions.
37 changes: 15 additions & 22 deletions apps/demos/Demos/Toolbar/Adaptability/Angular/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NgModule, Component, enableProdMode } from '@angular/core';
import { NgModule, Component, enableProdMode, inject } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import {
Expand Down Expand Up @@ -43,39 +43,32 @@ if (window && window.config.packageConfigPaths) {
})

export class AppComponent {
stylingMode = !themes.current().startsWith('generic') ? 'text' : undefined;

fontSizes: FontSize[] = [];
customService = inject(Service);

lineHeights: LineHeight[] = [];
stylingMode = !themes.current().startsWith('generic') ? 'text' : undefined;

lineHeight: number[] = [this.lineHeights[1]?.lineHeight];
fontSizes: FontSize[] = this.customService.getFontSizes();

lineHeights: LineHeight[] = this.customService.getLineHeights();
lineHeight: number[] = [this.lineHeights[1].lineHeight];

fontFamilies: FontFamily[] = [];
fontFamilies: FontFamily[] = this.customService.getFontFamilies();

headings: Heading[] = [];
headings: Heading[] = this.customService.getHeadings();

heading = this.headings[0]?.text;

fontStyles: FontStyle[] = [];
fontStyles: FontStyle[] = this.customService.getFontStyles();

textAlignItems: TextAlign[] = [];
textAlignItems: TextAlign[] = this.customService.getTextAlign();

textAlignItemsExtended: TextAlignExtended[] = [];
textAlignItemsExtended: TextAlignExtended[] = this.customService.getTextAlignExtended();

selectedTextAlign = [this.textAlignItems[0]?.alignment];

listTypes: ListType[] = [];

constructor(private service: Service) {
this.fontSizes = service.getFontSizes();
this.lineHeights = service.getLineHeights();
this.fontFamilies = service.getFontFamilies();
this.headings = service.getHeadings();
this.fontStyles = service.getFontStyles();
this.textAlignItems = service.getTextAlign();
this.textAlignItemsExtended = service.getTextAlignExtended();
this.listTypes = service.getListType();
listTypes: ListType[] = this.customService.getListType();

constructor() {
}

onTextAlignChanged(e: { itemData: { hint: string } }): void {
Expand Down

0 comments on commit c66b59e

Please sign in to comment.