0

this one work ::ng-deep .mat-option:first-child .mat-pseudo-checkbox{ display: none; }

why those wont work?? on other word when is ::ng-deep must be added?

  • .filter-option > .mat-pseudo-checkbox { display: none; }
  • .mat-option:first-child > .mat-pseudo-checkbox { display: none; }
  • Your question is confusing. What exactly do you need to do? According to [angular documentation](https://angular.io/guide/component-styles#deprecated-deep--and-ng-deep) this is deprecated. – GCSDC Nov 27 '18 at 19:36
  • @GCSDC the link you provided also says this "Until then ::ng-deep should be preferred for a broader compatibility with the tools."... so according to that document, keep using ::ng-deep until told otherwise – Marshal Nov 28 '18 at 01:21
  • Here is more detailed explanation on why using ::ng-deep is prefered until told otherwise... https://stackoverflow.com/questions/47024236/what-to-use-in-place-of-ng-deep/49308475 – Marshal Nov 28 '18 at 01:25
  • @GCSDC what I am trying to do is this: I've mat-select with multiple selection enabled (this **multiple** attribute makes options as a checkbox) and ofcourse I want to hide first-option checkbox (the first option has two bottons for select or deselect all) the first option has **class="filter-option"** so when I tried CCS rules without **::ng-deep** it's wont work att all utill I add it... thanks – al-hussein mahmoud Nov 28 '18 at 10:22
  • @al-husseinmahmoud isn't using *ngIf or binding to visibility and setting it to hidden suitable for your use case? – GCSDC Nov 28 '18 at 19:28
  • I ddin't use *ngIf because I've two buttons in first option and ofcourse I want them to show up :( ,,, Anyway it's works when using ::ng-deep but I'm wondering why? and when I've to add it,,, Thanks – al-hussein mahmoud Dec 03 '18 at 12:00

0 Answers0