equalHeightWidth.js 298 B

1234567891011121314
  1. angular.module("robware").directive("equalWidth", function() {
  2. return {
  3. restrict: 'A',
  4. link: function(scope, element) {
  5. scope.getHeight = function() {
  6. return $(element).height();
  7. };
  8. scope.$watch(scope.getHeight, function(height) {
  9. $(element).width(height);
  10. });
  11. }
  12. }
  13. });