Jimdo / angular-fontselect

A fontselect directive for AngularJS
MIT License
29 stars 9 forks source link

Broken with angular >=1.3.0 #42

Closed jquinter closed 9 years ago

jquinter commented 9 years ago

Tried several versions of angular (1.3.0 - 1.3.14), and with all of them I got an error when connecting to google devs (after providing my googleApiKey).

Details:

screenshot 2015-03-11 23 49 32

Relevant info at the end of the "json" dump

screenshot 2015-03-11 23 52 36

Pastebin with full dump: http://pastebin.com/kUVWE6QE PS: that one was generated when working with angular version 1.3.8 / notice the error was replicated with several other 1.3.X versions

Xiphe commented 9 years ago

This may be related to #36 #37 First of all, we have this project in production, along with angular 1.3.14

I tried to reproduce this, but have not figured out a way to do so. According to the error, it seems as if there's a watcher, picking up every font as it's being added to the list (which is a lot when you're using google fonts). But i've no clue how this is possible..

Please set up a jsFiddle, illustrating the setup you're using. You can use my test-api key when you're worried about publishing yours AIzaSyCZtrpL_EVp0qm-jnMvXP4xfvrDcW61pXg.

brad-sobie commented 9 years ago

I got the same error message when I was missing the webfontloader.js file. I had no clue this dependency was needed until I looked into the demo files. Do you think you could mention this in the readme?

Xiphe commented 9 years ago

Nice! I assume this was the issue. At least i could reproduce it by removing the webfontloader lib.

I updated the documentation and throw a readable Error if the library is not available.

I also updated the bower main section, its now including the library and the css. Since this will be picked up by tools like wiredep, i released this as a minor update.

Thanks for the catch @brad-sobie !