replace scope method calls with directives