From the course: Angular: Animations

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Component instantiation and data value translation

Component instantiation and data value translation - Angular Tutorial

From the course: Angular: Animations

Start my 1-month free trial

Component instantiation and data value translation

- [Narrator] Now that we have our new components built for the video title and large overlay, we need to instantiate them within our main application and replace the older dom element structures. Additionally, since angular animation states must be defined as strings, we'll need to create a new method to translate what currently exists as Boolean values into string values. So as we can see here, we have our isHidden piece coming in as a string. So what we need to do is go into our video.service TypeScript and add a new function in here. I'll just add this right up top here. It doesn't really matter where. And this is found in the snippets file. It's a function called checkHidden. And here we set isHidden as a string to false. And we check to see if this.isPlaying is set to true. If it is, then we set isHidden equal to a string of true, else, if it's not, we set it to a string of false and then simply return it. This will be invoked when we need those string values based on the…

Contents