Role of ionic surfactants on the nucleation and growth of silver nanoparticles