Guest User

Untitled

a guest
Nov 20th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. function converteFoto(evt){
  2. console.log(evt.target.result)
  3.  
  4. var obj = {
  5. "_id": $routeParams.id,
  6. "foto": evt.target.result
  7. }
  8.  
  9. CadastraFoto.fotoPerfil(obj).success(function(response){
  10.  
  11. }).error(function(response, status){
  12.  
  13. })
  14. }
  15.  
  16. $scope.cadastraFoto = function(){
  17. var input = document.getElementById('fotoPerfil').files[0]
  18.  
  19. var reader = new FileReader()
  20. reader.readAsDataURL(input)
  21. reader.onload = converteFoto
  22.  
  23. }
Add Comment
Please, Sign In to add comment