JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://code.angularjs.org/1.0.0/angular-1.0.0.js"></script>
<div ng-app="miniapp" resize>
Testing
</div>
CSS
div { border:1px solid red; }
JavaScript
var app = angular.module('miniapp', []);
app.directive('resize', function ($window) {
return function (scope, element) {
var w = angular.element($window);
var changeHeight = function() {element.css('height', (w.height() -20) + 'px' );};
w.bind('resize', function () {
changeHeight(); // when window size gets changed
});
changeHeight(); // when page loads
}
})