Install the angle brackets and drill the holes and everything before painting or taping the shelf.
If using wood drill holes to the screws so the screws wont tear the wood apart. Remember this allways when using screws.
I had these angels for me a long time ago. so basicly they didn't cost me anything.
I used four angle brackets, two to the each side so the shelf woud be supported evenly when hanging on the wall and it would stay on the wall. I have plasterboard walls so it is a pain to get something stay on the wall because the plasterboard is wery fragile and it wont hold anything whitout good support and some anchorbolts
If you make the hole to the side or on top of the shelf use good tools, as you can see i did not have such(pic.3) ... But if you are like me....too busy to buy proper tools for the job or don't have big hole drill.(as big as you need) You can allways drill small holes and then just give it a good smak with a hammer, and you have the hole for the wires. but warning....it wont be pretty to look at...