My Coco does the same thing. He bites at my pant legs. If I just stand at the door to watch my son go to the bus stop he goes nuts. my son can hardly get out the door. I have another yorkie so he is not alone so thats not it. That is the only time that he is aggressive. He just doesnt want you to leave.
COCO PEBBLES