first version using angularjs