Add a directive controller to avoid using 'this'