data sync directive for Angular.js