chore(cd): Add a toString() method

This code was originally authored by @mhevery in the
DirectiveInjector change.