we had this with indie- it was generally only when we walked her and she was frustrated with not being able to do exactly what she wanted to- so she'd bite our wellies, and if we went to correct her, or put her on her lead etc she'd turn round and try and bite us. It definitely became a habit, but eventually she's stopped doing it. We just completely ignored her- made ourselves as boring as possible when she did it. If i sensed it was coming i'd throw a ball to distract her. we haven't had an attack we at least 6 weeks now

i also now know she needs quite a bit of stimulation as we go for walks so i have the ball to throw every now and then, and throw it deliberately into thick cover so she has to find it and that has definitely helped. it also helps to distract her away from things i don't want her going near- horse dung for example!