Code Monkey home page Code Monkey logo

Comments (4)

BollingerInternational avatar BollingerInternational commented on June 26, 2024

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.

goodbomb avatar goodbomb commented on June 26, 2024

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.

goodbomb avatar goodbomb commented on June 26, 2024

Hey, did you get everything sorted out? Can I close this issue?

from angular-gulp-browserify-starter.

BollingerInternational avatar BollingerInternational commented on June 26, 2024

​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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.