testing functions from outside angular controller