angularjs dynamically add directive attribute to element