I want to add custom directive name to an element like we add attribute name and their values using attr() method in jquery .
For example supoose I have a custom directive named example-directive and I want to call this directive on an element programmatically like in the following js fiddle example I want to add example-directive on the div that has ID sam.
Could anyone tell me how to achieve this?