hasComputedStyle = function (target, key, expectedVal) {
    var hasValue = false;

    if (target && target.length) {
      var computedStyles = $window.getComputedStyle(target[0]);
      hasValue = angular.isDefined(computedStyles[key]) &&
        (expectedVal ? computedStyles[key] == expectedVal : true);
    }

    return hasValue;
  }
Checks if the target element has the requested style by key
@param {DOMElement|JQLite} target Target element
@param {string} key Style key
@param {string=} expectedVal Optional expected value
@returns {boolean} Whether the target element has the style or not