Example code for angularjs