I have 2 different directives. The first one is returns an iframe with a live video, and the second returns an iframe with a recent video.
The condition is: if live cont
Instead of handling the logic in the controller you can control it in UI as it will be easier.
-----Other Html Codes-----
-----Other Html Codes-----
And you can remove following lines of code from the controller
var liveIframe = ' ';
var videoIframe = ' ';
if (vm.live.items[0] != undefined) {
$('.iframe-container').append(liveIframe);
} else {
$('.iframe-container').append(videoIframe);
}