ANGULARJS conversion