Basic js functionality based on AngularJs