4
該指令火災:
simpleSearchApp.directive('afterResults', function($document) {
return function(scope, element, attrs) {
if (scope.$last){
scope.windowHeight = $document[0].body.clientHeight;
}
};
});
我試圖更新$scope.windowHeight
一個新的價值,但我不能訪問$scope
指令內。
我ng-repeat
與HTML指令:
<div ng-show="items" class="ng-cloak" ng-repeat="item in items" after-results>
{{item}}
</div>