* Insert the current component before the specified component parameter. * @param {BaseComponent} component * @throws {TypeError} Object trying to add is not a component
(component)
| 31 | * @throws {TypeError} Object trying to add is not a component |
| 32 | */ |
| 33 | insertBefore(component){ |
| 34 | if(!component || !(component instanceof BaseComponent)) throw TypeError('Object trying to add is not a component.'); |
| 35 | this.insertAdjacentElement('beforebegin', component); |
| 36 | } |
| 37 | } |