added ability to get data from function that creates the data array
changed style in order to be able to put the directive near other buttons (display: inline)