bug(modal, tooltip): fix scope.$root.$$phase error when scope.$root is null

Fixes an issue as outlined in #774 whereby nesting isolated and not isolated scopes sometimes doesn't have scope.$root set.

Closes #774