Safely Modifying Elements with ElementRef & Renderer in Ionic

Safely Modifying Elements with ElementRef & Renderer in Ionic

Follow Josh Morony on

Learn Ionic with Josh ☕

Hey, I hope you enjoy the article.

If you want a weekly update with my newest content, access to the blog's bonus content, or you want to sign up for one of my free beginner or advanced email courses just enter your details here or in the form below.

There often comes a time where we will need to modify the properties of an element in our application: its background color, or its position, or something else. By using ElementRef we are able to easily get a reference to an element and its properties, and although we can modify the element’s properties directly through the ElementRef, this is not the best way to do it.

In this video tutorial, we look at how to update DOM elements in a platform agnostic way with Angular’s Renderer.

Here’s the video:

If you enjoyed this article, feel free to share it with your friends ☝

Check out my latest videos: