justin-lau / ui-iconpicker

A Bootstrap 3 Icon Picker implemented in AngularJS
http://justin-lau.github.io/ui-iconpicker/
MIT License
32 stars 33 forks source link

How to use? #1

Closed tigerss closed 10 years ago

tigerss commented 10 years ago

Hi Justin, this is a great plugin for angular!

I am trying to run a basic example but I get this error: "ReferenceError: Can't find variable: define" (ui-iconpicker.min.js:6)

Here is my test: http://jsfiddle.net/WK8Y7/3

justin-lau commented 10 years ago

Hi tigerss, for now, this plugin is AMD only. You have to use require.js to load it in order to use the directive. This is because I have made this plugin when I was working on a project that needs an icon picker and haven't had time to further improve it.

Stay tuned, I have planned to make it compatible with non-AMD, and I will be working on it very soon =)

On Sunday, May 4, 2014, tigerss notifications@github.com wrote:

Hi Justin, this is a great plugin for angular!

I am trying to run a basic example but I get this error: "ReferenceError: Can't find variable: define" (ui-iconpicker.min.js:6)

Here is my test: http://jsfiddle.net/WK8Y7/3

— Reply to this email directly or view it on GitHubhttps://github.com/justin-lau/ui-iconpicker/issues/1 .

tigerss commented 10 years ago

Ok, great, I'll wait for the non-AMD version. I like the ideea of RequireJS but I couldn't set it up and also I have AngularJS already in place.

justin-lau commented 10 years ago

I have just pushed an updated tagged v0.1.4, added support to Non-AMD usage. I have also updated the fiddler http://jsfiddle.net/WK8Y7/3/ to demonstrate the proper way of loading the plugin.

tigerss commented 10 years ago

This is awesome, thank you very much!!! The link you provided is the same version that doesn't work. You have to press Update in jsFiddle to save the changes.

This is a working non-AMD version http://jsfiddle.net/WK8Y7/4/

justin-lau commented 10 years ago

Right, thanks! Hope my little plugin will do you some good in your projects =)

tigerss commented 10 years ago

This is gonna be viral! :+1:

Have you seen the jQuery alternative? http://victor-valencia.github.io/bootstrap-iconpicker/

justin-lau commented 10 years ago

Yes I have found a couple of icon pickers from Google including Victor's, but all of them depends on jQuery and I wanted one with Angular and the native jqLite only, therefore I implemented a version of my own quickly =)