docs($window): move use of $window to controller

Move use of $window from expression to controller, because accessing
$window in expressions is now dissalowed and doesn't work.


Code example doesn't work, this PR will fix this.