More generic code to create popover/tooltip containing an angular template