I'm experimenting with the idea of controlling the angular directive('ng-show') from the controller.
Here is what I'm attempting to do:
var node = `<div ng-show="this.length > 5">...</div>`;
var child = document.createElement('span');
child.innerHTML = node;
document.querySelector('.container').appendChild(child);
Is it a valid approach to set the directive on a DOM Node before it is added to the DOM Tree?