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

Better names for methods #31

Open
btesser opened this issue Oct 21, 2014 · 0 comments
Open

Better names for methods #31

btesser opened this issue Oct 21, 2014 · 0 comments
Labels

Comments

@btesser
Copy link
Contributor

btesser commented Oct 21, 2014

Hey,

I'd suggest switching to names that are more in line which what are the standard, or what angular uses in a few cases.

For example:

  1. I would get rid of the $ prefix for your variables. The $ is supposed to be reserved only for angular core to make it easy for angular to parse out what are internal properties and methods. Using a $ prefix has the potential to cause bugs. Consider using an underscore prefix '_'
  2. I would switch the method '$find' to something that better identifies the http method that will be used... get (or query to take angular's lead)
  3. Rather than using .success and .error, I would switch to a promise based approach using angular $q. Namely, .then for success, and .catch for error. These have the unique ability to change the response and pass it to the next promise.

I had submitted a pr when this project was in its infancy and it's great to see you continuing it. I recently just started an open source project of my own which automatically generates angular injectables from 3rd party libraries so they don't end up as global variables. let me know what you think. http://github.com/btesser/angular-global-injector

@klederson klederson added the ready label Feb 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants