Anonymous
Значки угловых материалов не отображаются
Сообщение
Anonymous » 08 янв 2025, 12:52
Я пытаюсь реализовать
автономное веб-приложение на основе Angular Material (v.18.2.x), но не вижу значков. Вот моя реализация:
package.json
Код: Выделить всё
[...]
"dependencies": {
"@angular/animations": "^18.1.0",
"@angular/common": "^18.1.0",
"@angular/cdk": "^18.1.0",
"@angular/compiler": "^18.1.0",
"@angular/core": "^18.1.0",
"@angular/forms": "^18.1.0",
"@angular/material": "^18.1.0",
"@angular/router": "^18.1.0",
"rxjs": "^7.8.1",
"tslib": "^2.5.0",
"zone.js": "~0.14.0"
}
[...]
main.ts
Код: Выделить всё
import { Component } from '@angular/core';
import { bootstrapApplication } from '@angular/platform-browser';
import { provideRouter, RouterOutlet } from '@angular/router';
import { provideAnimations } from '@angular/platform-browser/animations';
import { routes } from './app/app.routes';
import { SidebarComponent } from './app/components/sidebar/sidebar.component';
@Component({
selector: 'app-root',
standalone: true,
imports: [RouterOutlet, SidebarComponent],
templateUrl: './main.html',
styleUrl: './main.scss',
})
export class App {}
bootstrapApplication(App, {
providers: [
provideRouter(routes),
provideAnimations()
]
});
global_styles.css
Код: Выделить всё
@import '@angular/material/prebuilt-themes/indigo-pink.css';
/* Reset and base styles */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
[...]
HTML-файл
Результат
Вывод
Я пробовал включить некоторые зависимости, импортировать MatIconModule или импортировать в main.scss некоторые зависимости значков, но безуспешно
Подробнее здесь:
https://stackoverflow.com/questions/793 ... ot-showing
1736329971
Anonymous
Я пытаюсь реализовать [b]автономное[/b] веб-приложение на основе Angular Material (v.18.2.x), но не вижу значков. Вот моя реализация: package.json [code][...] "dependencies": { "@angular/animations": "^18.1.0", "@angular/common": "^18.1.0", "@angular/cdk": "^18.1.0", "@angular/compiler": "^18.1.0", "@angular/core": "^18.1.0", "@angular/forms": "^18.1.0", "@angular/material": "^18.1.0", "@angular/router": "^18.1.0", "rxjs": "^7.8.1", "tslib": "^2.5.0", "zone.js": "~0.14.0" } [...] [/code] main.ts [code]import { Component } from '@angular/core'; import { bootstrapApplication } from '@angular/platform-browser'; import { provideRouter, RouterOutlet } from '@angular/router'; import { provideAnimations } from '@angular/platform-browser/animations'; import { routes } from './app/app.routes'; import { SidebarComponent } from './app/components/sidebar/sidebar.component'; @Component({ selector: 'app-root', standalone: true, imports: [RouterOutlet, SidebarComponent], templateUrl: './main.html', styleUrl: './main.scss', }) export class App {} bootstrapApplication(App, { providers: [ provideRouter(routes), provideAnimations() ] }); [/code] global_styles.css [code]@import '@angular/material/prebuilt-themes/indigo-pink.css'; /* Reset and base styles */ * { margin: 0; padding: 0; box-sizing: border-box; } [...] [/code] HTML-файл [code] [/code] Результат Вывод Я пробовал включить некоторые зависимости, импортировать MatIconModule или импортировать в main.scss некоторые зависимости значков, но безуспешно Подробнее здесь: [url]https://stackoverflow.com/questions/79338412/angular-material-icons-not-showing[/url]