npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

angular-pallet-bundle

v2.1.0

Published

This library is a directive that wraps the following:

Downloads

4

Readme

Angular Pallet Bundle

This library is a directive that wraps the following:

This directive is not intended to be a replacement for Ng-File-Upload. Rather, it uses its potential and prevents you to deal with annoying details like:

The visual representation of the upload progress.

The visual representation of errors in the upload process.

The file preview. Not only images, files of any kind.

The visual representation of the multiple files to upload.

As "the icing on the cake", it handles the upload process asynchronously using the angular-pallet directive.

Installation

bower install ng-file-upload --save
bower install https://github.com/platanus/angular-pallet-bundle --save

Include the JS files in your project and the library as an Angular Dependency

angular.module('yourapp', ['platanus.palletBundle']);

The library comes with a proposed stylesheet under /dist/angular-pallet-bundle.css. You can use it or create your own.

Usage

To make it simple, I'm going to show you a use case example... Suppose you have a User model. This model has two attributes: avatar (user photo) and file (a document or spreadsheet). So, from your application, you want to let the user:

  1. Upload the avatar. See a preview (a thumbnail maybe), be sure the upload was successful.
  2. Upload the file. See a preview (a link), be sure the upload was successful.
  3. Submit the form and link all the user data on the server.
<form method="post" action="/users">

  <pallet-upload-handler
    render-image-as="thumb"
    no-document-text="No avatar..."
    upload-url="uploads"
    ng-model="user.avatarIdentifier">
  </pallet-upload-handler>

  <pallet-upload-handler
    no-document-text="No file..."
    upload-url="uploads"
    ng-model="user.fileUrl">
  </pallet-upload-handler>

  <input type="hidden" ng-value="user.avatarIdentifier" name="user[avatar_identifier]" />
  <input type="hidden" ng-value="user.fileIdentifier" name="user[file_identifier]" />

  <input type="submit" value="Send" />

</form>

In order to make this directive work, the POST /uploads response must be a json with the following format:

{
  "upload": {
    "identifier": "RmQwYe5j",
    "file_extension": "png",
    "file_name": "pikachu",
    "download_url": "http://server.platan.us/uploads/RmQwYe5j/download"
  }
}

Paperclip Upload solves the server side for you.

Directive Options:

Mandatory
  • ng-model: to keep the identifier(s) of the uploaded file. If multiple attribute is "true", the model will have a value like this: ["EJ6pOl5Y", "ZN5BaK3j"] otherwise "EJ6pOl5Y".
  • upload-url: must contain the url to perform the POST to save files.
Optional
  • no-document-text: custom message to show when the url is empty. By default, will show nothing.
  • render-image-as: this option is only for images. You can choose, to show images: as link or thumb. If this attribute is not present will show thumbnail and link.
  • progress-type: with "bar" value, will show a progress bar. With indicator value will show a progress badge with this format {progress}% (for example 35%). Default is indicator.
  • multiple: if present, multiple upload functionality will be enabled.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Credits

Thank you contributors!

angular-pallet-bundle is maintained by platanus.

License

angular-pallet-bundle is © 2015 platanus, spa. It is free software and may be redistributed under the terms specified in the LICENSE file.