adding finishing touches to angularjs implementation