See, this is the crux of the argument, as I understand it. People who believe the law was intended to protect the state's rights to have a militia put the weight on the first part, those who believe its for individual rights put it on the second. Heller, as I understand it, sided with the second part, but that decision isn't without controversy.
Personally I am not a fan of Heller as it has bolstered the "guns everywhere" movement which I am not a fan of.