angular 1.2 rewrite