angular 2 best way to constantly update dom position -


i'm building game in angular (v4) , aware direct dom manipulation (if ever) correct route angular. however, i'm building, i'm not sure see viable avenue.

what i'm needing component handles it's dom updating rotational positions of several elements simultaneously (think of solar system model). there 2 main routes see, first direct dom manipulation updates on component input change. second component has inline style tags e.g. [style.whatever]="thing.whatever".

my second route seems kind of it's still direct dom manipulation, not in javascript.

i doing things 'right' way whenever possible, input helpful.

i not use/plan/want use jquery @ in project.

update

just realized i'm idiot, , wouldn't need programmatic dom updates, need set initial css properties need start, , animation speed. since it's constant thing, predictable animation, can let css work. still know if proper set css properties in code, or attributes of component.

here comes mind of can (not comprehensive of course)

use bindings, :

 @hostbinding('style.whatever')    whatever: thing     @hostlistener('window:resize', ['$event'])   setheight() {     this.height = 200px;   } 

template variables

@viewchild('input') input: elementref; <input #input ...> 

Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -