We investigated the injection of electrons in laser-wakefield acceleration induced by a self-modulated laser pulse by a two dimensional particle-in-cell simulation. The localized electric fields and magnetic fields are excited by the counter-streaming flows on the surface of the ion bubble, owing to the Weibel or two stream like instability. The electrons are injected into the ion bubble from the sides of it and then accelerated by the wakefield. Contrary to the conventional wave breaking model, the injection of monoenergetic electrons are mainly caused by the electromagnetic process. A simple model was proposed to address the instability, and the growth rate was verified numerically and theoretically.