Formation and rotation of disc galaxies with haloes