GithubHelp home page GithubHelp logo

register as a bower module about choices HOT 6 CLOSED

choices-js avatar choices-js commented on April 28, 2024
register as a bower module

from choices.

Comments (6)

jshjohnson avatar jshjohnson commented on April 28, 2024 1

Hey, could it try it again now? I've just published it - apologies I don't actually use Bower!

from choices.

jshjohnson avatar jshjohnson commented on April 28, 2024

Hey @herbertpimentel,

There was a merged pull request a while ago to do this: #38

If you have any issues installing with Bower, let me know.

Thanks

from choices.

herbertpimentel avatar herbertpimentel commented on April 28, 2024

@jshjohnson I can´t find your pack at bower repo

$ bower search choices

Search results:

    dindinet-cookiechoices https://github.com/dindinet/cc.git

I have also tryed at https://bower.io/search/

So I belive you forgot to register that

bower register YourAwesomePackageName git://github.com/yourGitHubUsername/YourAwesomePackageName.git  

I am also facing some problems to import it using requirejs. So could you provide some example about how should I proceed ?

define(function(require){
  var choices = require('libs/choices.min');

  // it is undefined 
  console.log(choices); 
});

from choices.

herbertpimentel avatar herbertpimentel commented on April 28, 2024

@jshjohnson the bower module now is fine, but I am facing problems to import choices using require.js

I am also facing some problems to import it using requirejs. So could you provide some example about how should I proceed ?

from choices.

jshjohnson avatar jshjohnson commented on April 28, 2024

Hi @herbertpimentel,

This should work for you:

requirejs.config({
  baseUrl: '/',
  paths: {
    choices: 'bower_components/choices.js'
  }
});

requirejs( ['choices'], function(Choices) { 
 var example = new Choices();
});

from choices.

herbertpimentel avatar herbertpimentel commented on April 28, 2024

@jshjohnson I have created a sample project to show how I am trying to use choices with requirejs following your instructions above

https://github.com/herbertpimentel/choicesjs_test

You just need run:

  1. Install bower globally using npm
> npm install -g bower 
  1. Install the bower dependences
>bower install 

As I hove you will see choices is successful loaded but I receive a message TypeError: Choices is not a constructor... when I try to use it.

maybe it is something with webpack exportage. I am very curious about it

from choices.

Related Issues (20)

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.