Moving rating login into an angular directive

Cleaning up angular code