Another thought may be that the dog was growing or attacking simply because you were on the other side of the fence. Things may have been different if you went inside. The 'fence' maybe something this dog has at home and it is common practice for him to bark at whats on the other side.
Example, you see cute barking dog at fence. You approach fence and offer your hand. Dog is not aggressive. It was just trying to get your attention.
Sorry I am speaking in silly sentences, I just realized I was doing that. I am in kid speaking mode right now, forgive me!