Turning file reader into a directive