Closed smacker closed 10 years ago
I do have a example. You can see it here: https://github.com/smacker/angular-activerecord/commit/7f9c697aa7f8eb0b3eac6ca095aa3dfb3413b8a9
I believe a Factory is the correct type, i want the ActiveRecord class to behave as predictable as possible. Making it a Provider would promote the behavioral differences per project.
You can still override functions using the $provide.decorator if you wanted to.
Right now your module is a factory. What do you think about converting it to provider?
I've I issue to convert all responses (return data.items) and requests (add token) in my app, also all my urls have a prefix. It's possible to override $parse, $sync, url method in my class, then extend this class, but it looks not like angular's way.
Provider lets override those functions in config of application. That looks much cleaner.