Coder Social home page Coder Social logo

flox1an / angular-profile-picture-upload-example Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 17.0 547 KB

Angular 4 example to create a drag and drop file upload for profile pictures based on ng2-file-upload

TypeScript 65.88% JavaScript 9.81% HTML 15.06% CSS 9.25%
ng2-file-upload angular4 bootstrap3

angular-profile-picture-upload-example's Introduction

Angular Profile Picture Upload Example

This is a small example on how to use the ng2-file-upload module to add a profile image with drag and drop capability.

  • Angular 4
  • ng2-file-upload
  • File upload through drag and drop
  • File upload through click and file selector

This example is not fully working without a service that stores images. This service is not included. The code is meant to be taken as a reference and built upon.

Screenshots

Empty Profile Picture Profile Picture after Upload

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the -prod flag for a production build.

angular-profile-picture-upload-example's People

Contributors

angular-cli avatar flox1an avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

angular-profile-picture-upload-example's Issues

Unexpected end of JSON input

core.js:1427 ERROR SyntaxError: Unexpected end of JSON input
at JSON.parse ()
at eval (profile-picture.component.ts:31)
at SafeSubscriber.schedulerFn [as _next] (core.js:4351)
at SafeSubscriber.__tryOrUnsub (Subscriber.js:239)
at SafeSubscriber.next (Subscriber.js:186)
at Subscriber._next (Subscriber.js:127)
at Subscriber.next (Subscriber.js:91)
at EventEmitter.Subject.next (Subject.js:56)
at EventEmitter.emit (core.js:4319)
at XMLHttpRequest.xhr.onreadystatechange [as __zone_symbol__ON_PROPERTYreadystatechange] (file-uploader.class.js:295)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.