Instead of using a globally namespaced utility function to
setScopeParams, create a service and inject it where needed.