Ian McNally

$window.open

May 21, 2014

If you’re doing a $window.open in Angular and getting the error:

Referencing the Window in Angular expressions is disallowed

Turns out you might be returning your $window.open call (especially if you’re writing Coffeescript). So just return true after it:

$scope.openSomething = ->
  $window.open '/something'
  true

And all your errors go away.


Ian McNally

Hey, I'm Ian. I build websites and write about what I learn as I go. Follow me on Twitter.