  We study the homotopy types of moment-angle complexes, or equivalently, of
complements of coordinate subspace arrangements. The overall aim is to identify
the simplicial complexes K for which the corresponding moment-angle complex Z_K
has the homotopy type of a wedge of spheres or a connected sum of sphere
products. When K is flag, we identify in algebraic and combinatorial terms
those K for which Z_K is homotopy equivalent to a wedge of spheres, and give a
combinatorial formula for the number of spheres in the wedge. This extends
results of Berglund and Joellenbeck on Golod rings and homotopy theoretical
results of the first and third authors. We also establish a connection between
minimally non-Golod rings and moment-angle complexes Z_K which are homotopy
equivalent to a connected sum of sphere products. We go on to show that for any
flag complex K the loop spaces of Z_K and DJ(K) are homotopy equivalent to a
product of spheres and loops on spheres when localised rationally or at any odd
prime.
