Angular js directives understanding