Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I use debug in the browser with AngularJS and Bower? #210

Closed
andreicristianpetcu opened this issue Jul 29, 2015 · 5 comments
Closed

Comments

@andreicristianpetcu
Copy link

Hello,

Is there a tutorial on how to use it in the browser with AngularJS?
window.myDebug = require("debug"); does not work for me since I do not use the npm package management in the browser, I use bower for that.

I managed to make it work fine in the nodejs backend.

Thank you!

@stephenmathieson
Copy link
Contributor

when in non-commonjs env, it's exposed as window.debug

@nmccready
Copy link

plunkr here http://plnkr.co/edit/C4PcSxUhLKywBzuKUqLu?p=preview wow, this should be in the Readme.md

@andreicristianpetcu
Copy link
Author

Thank you @nmccready

@nmccready
Copy link

If you do not have CommonJS loaded is there anyway to not override window.debug? I am looking for options to not browserify my lib.
See: nmccready/angular-simple-logger#4

@ndraiman
Copy link

ndraiman commented Jun 7, 2016

@nmccready Thank you.
made me realize that the npmjs version isn't what i need for the browser,
simply took the file from this repo's dist folder and followed your plunker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants