make the code Angular compatible