update angularjs and promise patterns