Test and best practices for angularjs