Q:

How to get Dom's height in angular2?

<div style="width:100%;height:100%;position:relative;background-color:white" id ="OuterSvg"> </div>

onPageLoaded(){
     console.log(document.getElementById("OuterSvg").offsetHeight); //get 0.
}   

ngAfterViewInit(){
     console.log(document.getElementById("OuterSvg").offsetHeight); //get 0.
}

I have try onPageLoaded() and ngAfterViewInit() but also not work...
SO how to i get the element's height/width after the dom's height rendered?

A:

What you want is the height of an element after Angular has processed the event lifecycles, compiled the html and injected it on the page, and the browser finished rendering that html. 
You need the height only when its stable, not before. The problem is that all that is done after Angular relinquishes the Javascript VM turn, and there is no "browser finished rendering" or "layout calculated" event. 
You need to give the browser a chance to calculate the height and apply it. For example call setTimeout. This will give the browser the chance to calculate the height.
Probably an interval of zero ms would work. This is because calls to offsetHeight trigger a layout recalculation if needed (see here). 
This is a general problem and is not framework specific, its just the way browsers work. In general its better to try to avoid as much as possible this kind of logic (wait until height is stable to do X), it tends to create hard to fix issues.

A:

Try the function ngAfterViewInit
ngAfterViewInit(){
     console.log(document.getElementById("OuterSvg").offsetHeight);
}

And is your div HTML like it is? Otherwise you might consider removing the space after id:
<div style="width:100%;height:100%;position:relative;background-color:white" id="OuterSvg">

