Directive low-level DOM access
In the last lesson, we set up our custom directive and can now access the element the directive is applied to and the data passed to it in the mounted
hook.
In this lesson, we're going to add a new child element to display the number of seats.
Creating span child element
Let's begin by creating a new span element. To do this we'll use document.createElement("SPAN")
and assign this to a variable span
.
Click to load comments...