Modified directive to pass method as attribute