Angel's a noir detective. The title screen couldn't be any more explicit if it spelled Spade and Marlowe out in flashing neon lights. He fulfills some of Chandler's requirements of the Private Eye (can also be read as private I). "Down these mean streets a man must go who is not himself mean, who is neither tarnished nor afraid. The detective in this kind of story must be such a man. He is the hero, he is everything. He must be a complete man and a common man and yet an unusual man". Chandler's code is anachronistic - it's that of the knight.
Hammett's Spade also abides by a code: “When a man's partner is killed he's supposed to do something about it. It doesn't make any difference what you thought of him. He was your partner and you're supposed to do something about it. Then it happens we were in the detective business. Well, when one of your organization gets killed it's bad business to let the killer get away with it. It's bad all around-bad for that one organization, bad for every detective everywhere". Spade's code is kinda less personal...it's that of capitalism, commerce and business.
In both cases, codes give meaning in a meaningless world. They protect the detective from an anarchic world where almost everything is corrupt - from the individual to institutions (the Law, the Police...blah...blah...blah....down to the family). In BtVS, these institutions are problematic, sometimes comedic but there's still an element of hope (until S12). For me, this is the biggest difference. AtS underscores the fact that Oedipus (trying to find out something about himself) was the first detective.
Occasionally he's Mike Hammer. I can't remember if Hammer has a code - to all intents and purposes, he's just a selfish dick.
I rest my case about families. 😏