Angularjs directive for parsing files