В настоящее время моя реализация выглядит так:
[img]https: //i.sstatic.net/wjTjU94Y.png[/img]
Как видите, не выбираются правильные цвета темы, а цвет фона панели и цвета текста отключены. Как я могу решить эту проблему.
В HTML-файле компонента я сделал:
Код: Выделить всё
To [Date & Time]
В scss-файле компонента я сделал:
Код: Выделить всё
@use "@ng-matero/extensions" as matx;
@use "../../m3-theme.scss" as custom-theme;
.container {
display: grid;
grid-template-columns: repeat(12, 1fr);
@include matx.all-component-themes(custom-theme.$mtx-theme);
}
Здесь mtx-theme — это тема Angular Material3.
Код: Выделить всё
$mtx-theme: mat.define-theme(
(
color: (
theme-type: dark,
primary: $_primary,
tertiary: $_tertiary,
),
)
);
здесь цвета определены правильно. Могу сказать, что тема работает, потому что я использую одну и ту же цветовую тему для всего приложения.
В файле TS компонента у меня есть:
Код: Выделить всё
export class MetricsRealtimeDataIngestionComponent implements OnInit {
type: MtxDatetimepickerType = 'datetime';
mode: MtxDatetimepickerMode = 'auto';
twelvehour: boolean = true;
timeInterval: number = 1;
timeInput: boolean = true;
// ... other stuff
}
Подробнее здесь: https://stackoverflow.com/questions/786 ... in-angular