Client: created truncateToggleDirective to minimize duplicate code.