Weight input control (English/metric unit switch) rewritten as Angular directive