chain promise instead of using ng-if