Add spinner to iocaine button and refactor a little the directive