Please do not use document.yadada to select dom elements. You will inadvertently grab other elements in the DOM but not on the page you’re currently looking at. It’s inevitable.
Use ElementRef.
If you look at this example I’ve done before, at the camera.ts you’ll see how I manipulate dom elements safely.
Totally agree, but what if my HTML element doesn’t have an ID? How can I THEN use elementRef? I’m trying to manipulate the SCSS of Ionic Loading Controller component (ion-backdrop), which doesn’t have an ID.
you can set backdrop styles globally in app.scss. Something like this
// http://ionicframework.com/docs/theming/
// App Global Sass
// --------------------------------------------------
// Put style rules here that you want to apply globally. These
// styles are for the entire app and not just one component.
// Additionally, this file can be also used as an entry point
// to import other Sass files to be included in the output CSS.
//
// Shared Sass variables, which can be used to adjust Ionic's
// default Sass variables, belong in "theme/variables.scss".
//
// To declare rules for a specific mode, create a child rule
// for the .md, .ios, or .wp mode classes. The mode class is
// automatically applied to the <body> element in the app.