I have removed the need to use id 'wrapper' on the div. Now, the directive  uses the div in which it was placed.