requires angular 1.2+