Hi,
I'm adding the css references inside component.css file instead of creating a style and adding the same in angular.json's style section.
Doing so, it's not rendering the css as expected. Could you let me know if it is mandatory to have these css's added to angular.j
Hi Vasamsetti,
To ensure that your CSS styles are properly applied in an Angular component, you should follow these best practices:
[app.component.css]
.schedule-cell-dimension.e-schedule .e-vertical-view .e-date-header-wrap table col, width: 200px; } |
[app.component.ts]
once ensure ViewEncapsulation.None is correctly used in your project.
import { Component, ViewEncapsulation } from '@angular/core'; import { MonthService, DayService, WeekService, WorkWeekService, TimelineViewsService, TimelineMonthService, ResizeService, DragAndDropService } from '@syncfusion/ej2-angular-schedule';
@Component({ selector: 'app-root', templateUrl: 'app.component.html', styleUrls: ['app.component.css'], encapsulation: ViewEncapsulation.None })
export class AppComponent { // Your component logic here } |
[angular.json]
"projects": { "demo": { "root": "", "sourceRoot": "", "projectType": "application", "prefix": "app", "schematics": {}, "architect": { "build": { "builder": "@angular-devkit/build-angular:browser", "options": { "outputPath": "dist/demo", "index": "src/index.html", "main": "src/main.ts", "polyfills": "src/polyfills.ts", "tsConfig": "src/tsconfig.app.json", "assets": [ "favicon.ico", "assets" ], "styles": [ "src/styles.css", "src/app/app.component.css" ], "scripts": [] }, |
Sample link: https://stackblitz.com/edit/angular-iucqkv-s1vpwf?file=angular.json,src%2Fapp.component.ts
Please get back to us if you need any further assistance
Regards,
Vijay