Hi Guys,
All my components use encapsulation Emulated (default), but all samples in Syncfusion documentation use Encapsulation None.
When I use Emulated my grid doesn't render ok. What I need to do to use default encapsulation?
Regards,
Jairo Marques
View encapsulation defines whether the template and styles defined within the component can affect the whole application or vice versa. Angular provides three encapsulation strategies:
Emulated
(default) - styles from main HTML propagate to the component. Styles defined in this component's@Component
decorator are scoped to this component only.Native
- styles from main HTML do not propagate to the component. Styles defined in this component's@Component
decorator are scoped to this component only.None
- styles from the component propagate back to the main HTML and therefore are visible to all components on the page. Be careful with apps that haveNone
andNative
components in the application. All components withNone
encapsulation will have their styles duplicated in all components withNative
encapsulation.
Source:
https://angular-2-training-book.rangle.io/handout/advanced-components/view_encapsulation.htmlPavithra S.,unfortunately I couldn't use ViewEncapsulation.None because this setting is interfering in my project and other components that I use.Why Essential JavaScript 2 Style doesn't have a style css that I can use inside the component with ViewEncapsulation.Emulated? is this not a idea behind componentization?As a workaround I'm trying to use globally in my styles.scss but I'm having some issues. In my component I want to hide the grid header, so I put in my component scss:.e-grid { //Hide grid Header.e-gridheader, .e-columnheader {display: none;}.e-headercontent {display: none;}.e-icon-gdownarrow,.e-icon-grightarrow {text-indent: 1px;}.e-recordplusexpand,.e-recordpluscollapse {width: 5px;padding-left: 10px;}.e-groupcaption,.e-indentcell,.e-recordplusexpand,.e-recordpluscollapse {padding-left: 20px;}}But the header ins only hidden if I use ViewEncapsulation.NonePlease help me!
.e-grid ::ng-deep{ //Hide grid Header
.e-gridheader, .e-columnheader {
display: none;
}
. . .
} |