Comments (4)
Disregard, I explored a little bit and found someone else with the same issue that you helped resolve. Essentially a return statement belongs in the service function, in which returns an object. Example:
var ServiceName = function() {
return {
excuses : [
{id: 1, excuse: "Dog ate my homework"},
{id: 2, excuse: "Sister ate my homework"}
]
};
};
ServiceName.$inject = [];
module.exports = ServiceName;
However, I am trying to create a service with another service injected, namely the $firebase service, then I am doing a query for which I want the results to stay persistent through the app so I stay DRY. If you can talk me out of it or provide a solution before I do, I would appreciate it. Thank you.
var ServiceName = function($firebase) {
return {
data : function () {
var fb = new Firebase('https://<your firebase>.firebaseio.com'),
sync = $firebase(fb);
return sync.$asArray();
}
};
};
ServiceName.$inject = ['$firebase'];
module.exports = ServiceName;
from angular-gulp-browserify-starter.
Hi, glad you got your initial problem sorted out.
I've never used firebase, so I can't comment on it specifically, but what you are trying to do sounds reasonable. Stackoverflow is generally a great resource for questions that are outside the overall scope of this project. Now you're dealing with angular's dependency injection, which will work the same in any angularjs app architecture.
This question seems to deal with firebase specifically, so it may help you with your current path:
http://stackoverflow.com/questions/25344829/how-do-you-inject-dependencies-into-services-in-angular-js
from angular-gulp-browserify-starter.
Hey, did you get everything sorted out? Can I close this issue?
from angular-gulp-browserify-starter.
Ben,
I didn't. I moved on to other things and will have to circle back on it.
Close it if you wish and I can get back to you later on it if that's better.
Sincerely,
August Bollinger
Founder/Creator/Quant - Chayton Falke Global Equity™
Founder/Lead Data Scientist - Composite Analytics™
(949) 257-2854
Life can be absolutely phenomenal. And it should be. And it WILL be! :)
On Sun, Feb 8, 2015 at 12:15 PM, Ben Scott [email protected] wrote:
Hey, did you get everything sorted out? Can I close this issue?
—
Reply to this email directly or view it on GitHub
#8 (comment)
.
from angular-gulp-browserify-starter.
Related Issues (20)
- Prefix options are passed to pipe rather than prefix. HOT 1
- nested views/modules HOT 9
- Prerender.io HOT 2
- License HOT 4
- Adding karma-coverage HOT 25
- using injection of bower components inside modules HOT 1
- Unresolved Dependencies HOT 1
- Filters HOT 1
- adding vendor chart.js angular-chart.js HOT 6
- Dublicate bundle for libs in vendorJs task HOT 3
- Triying to colaborate: push a new branch HOT 1
- Troubles adding ngTable to angular-gulp-browserify-starter HOT 2
- $stateParams undefined HOT 10
- MongoDB HOT 2
- When javascript syntax Error occur the gulp will not show the error and not start the app HOT 1
- Collapse menu do not work
- How to inject services etc. into controllers HOT 3
- images HOT 5
- Problem setting up crawlme HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-gulp-browserify-starter.