Modified the client side code

Modified the client side angularjs code to recommended approach
according to documentation at angularjs.org