JSFiddle - React, Tailwind, and code Playground

by choroshin

HTML

<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
<div ng-app="App">
    <header>
      <div elHeightResize="" class="windowHeight"  >test</div>  
    </header>

</div>

CSS

.windowHeight{
    border: 1px solid black;
}

JavaScript

var app=angular.module('App', []);
app.directive('elheightresize', ['$window', function($window) {
    return {
        link: function(scope, elem, attrs) {
            scope.onResize = function() {
                var header = document.getElementsByTagName('header')[0];
                elem.windowHeight = $window.innerHeight - header.clientHeight;
                $(elem).height(elem.windowHeight);
            }
            scope.onResize();

            angular.element($window).bind('resize', function() {
                scope.onResize();
            })
        }
    }
}])