I wish I could give you a more specific answer but this is another one of those problems that requires an examination and detailed history taking. Ankle biting and sudden attacks are most often associated with predatory aggression. Cats have a strong natural desire to hunt. Inside the house, there isn't much to satisfy this desire. In some cases it is possible to provide a more appropriate toy to satisfy the predatory urge.
Some people just tie a toy on a string to their belt to provide a better target then their ankles.
This also provides a lot of exercise which is a good release of the pent up energy in many kittens. Most cats will outgrow this behavior by the time they are a couple of years old and are much better if given alternatives objects to attack and sufficient exercise. . If your cat doesn't respond to this, it might be a good idea to consult with a certified animal behaviorist to make sure that predatory behavior is the problem. Inc. Opinions expressed are those of Dr. Richards.