This directive works fine but I have the feeling that I'm not doing it the angular way with .attr('hide', 'true'). Is there a better way to show or hide elements from a directive?app.directive('myRandomshow', function() {  // Show a random element from child elements  function randomIntFromInterval(min, max) {    return Math.floor(Math.random() * (max - min + 1) + min);  }  return {    link: function(scope, element) {      // Ensure everything is initialy hidden      element.children().attr('hide', 'true');      scope.$on('event::event', function() {        // Show result        element.children().attr('hide', 'true');        element.children().eq(randomIntFromInterval(2, element.children().length - 1)).removeAttr('hide');      });    }  };});
Directive to randomly show/hide elements
javascript;angular.js