Bidirectional unit conversion with a general-purpose Angular directive