implement object as directive