ice7

Dynamically size containers - Angular 6

Aug 9th, 2018
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Angular 6 -  Dynamically size parent container width
  2. let _container = document.querySelector('.base-component');
  3. if (this.alliances.length > 3) {
  4.     let _pxl = _container['clientWidth'] + (this.alliances.length - 3) * 350;
  5.     _container['style']['width'] = _pxl + 'px';
  6. }
Advertisement
Add Comment
Please, Sign In to add comment