Replace the rootscope by a service.