angular.module("robware").directive("equalWidth", function() { return { restrict: 'A', link: function(scope, element) { scope.getHeight = function() { return $(element).height(); }; scope.$watch(scope.getHeight, function(height) { $(element).width(height); }); } } });