Using AngularJs to implement the task1