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

Move use of `$window` from template to controller, because accessing `$window`
in expressions is now disallowed and doesn't work.

Closes #5110

ammula88/angular.js,ammula88/angular.js,ammula88/angular.js,ammula88/angular.js,ammula88/angular.js