This directive fires when it ng-repeatfinishes using scope.$last:
simpleSearchApp.directive('afterResults', function($document) {
return function(scope, element, attrs) {
if (scope.$last){
scope.windowHeight = $document[0].body.clientHeight;
}
};
});
I am trying to update with a $scope.windowHeightnew value, but I cannot access the $scopeinside of the directive.
My ng-repeatHTML with the directive:
<div ng-show="items" class="ng-cloak" ng-repeat="item in items" after-results>
{{item}}
</div>
alyx source
share