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>


沒有留言:

自訂權限驗證機制

// 使用 filter [Route("api/[controller]")] [ApiController] [Authorize] [TypeFilter(typeof(CustomAsyncAuthorizationFilter))] public c...