My cocker did the same when he was 5 months old. The best way to stop this is to ignore it. When he gets likes this during your walk, just stop walking and just look the other way, eventuelly the dog will give up. I did the same with my dog and he has only tried it several times then he realized it was no fun being ignored like that and he never tried it again. Always ignore a dog in cases like this, because everything you do (even if your shouting at him) he sees as a victory. Ofcourse when he already had some succes for several times it is much harder to stop the biting, so probably you'll have to stand still on the street and ignore your dog for quit a while (and it may look very silly for people passing by), but you will see that it really helps eventuelly.
Succes !! Tjarda