reactive programming w.r.t angularjs