2020年11月3日 星期二

Angular 設定容器高度為可用剩餘高度

使用 attribute directive

建立 class : ng generate directive bodyinner --module app
constructor(private el: ElementRef) {
}
ngAfterViewInit() {
    this.el.nativeElement.style.height = (window.innerHeight - this.el.nativeElement.offsetTop) + 'px';
}

html:
<div appBodyinner style="overflow-y:auto"></div>


沒有留言:

批次檔正確處理中文

1. 確定檔案編碼為 UTF-8 2. 開頭先執行 chcp 65001