nest ng-if to avoid js error