DI may be the solution for languages like (wait for it) Java. And while I perfectly agree that it has its place, and it's a wonderful technique (I even use it at home and at work!), it's not the solution for stateless objects
To expand on it: It makes whole buckets of sense to DI something like a database connection. That has state, you want to pass it around, and you also want to mock and not be tightly coupled. Makes sense.
For a helper function? No, js is a dynamic language. We have a dynamic solution.
@moesef Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
I'm trying to filter an array of ajax Promise objects based on the jqXHR status. I can only get the status when it's 503 and when it's 200, status is undefined. How can I filter the array, only returning jqXHR objects with status 200
var userData = {};
userData.user1 = {"creds": {"userid":"...
I am taking small steps in FRP land with BaconJS. I have the following code:
# This will eventually get resolved with some value
dfd = Promise.defer()
promised = Bacon.fromPromise dfd.promise
# Values are occasionally being pushed in here
bus = new Bacon.Bus
# 1. attempt
bus.combine promised, ...
@WenqinYe Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
Someone (it better not be me) should write a really nice functional library. Not the bullshit that keeps circulating about "hey look I wrote an async forEach, download my library". Stuff that'd keep you from writing these short inline functions all the time.
Like, how many times did I need to do arr.every(function (val) { return !something(val); });
I have someone asking a question that really looks like they want to set up REST urls, but he wants to know how to "bootstrap" part of his application to do it.
I don't have the slightest pflagerville what he's talking about.
I am working on a movie recommendation website. Where every movie, director, producer has its own page. The front page of the website gives the movie recommendations, and a movie page is rendered over the main recommendation page when clicking on a movie link as shown in the image.(I am using ng-...
@Zirak except when you have more libraries and code and want to scope. With your mockedAngular.$http you're mocking it for everyone using mockedAngular, I might want to serve a different copy to different modules.
@Zirak no, it's not, you're Object.createing angular, what if some services inside it use $http internally? Do they have to use the global reference now for it?
Even if we ignore the loss of clarity of what it uses in every module...
First, clarity isn't the point of discussion here: I'm getting interfaces in DI, they can be real or they can be mocked. How do you know which one gets which?
@RobertHarvey it compiles with Angular as an Angular view
@Zirak an app consists of whatever code you have to accomplish whatever action you wish to bring about. A service is a component from within your app that needs to interact with other components and might require using some components.
A popcorn machine should not care about where it gets it corn from, it should not go grocery shopping, all it cares is that it has a steady supply of corn.
MEAN refers to first letters of the four components of a free and open-source solution stack for building dynamic web sites. MEAN is a full-stack JavaScript platform designed for web applications. The components of the MEAN stack are as follows:
* MongoDB, a NoSQL database;
* Express.js, a web applications framework;
* Angular.js, a JavaScript MVC framework for web apps;
* Node.js, a software platform for scalable server-side and networking applications.
See also
* LAMP (software bundle)
* MAMP
* WAMP
References
All a popcorn machine does when it needs corn (as if it was alive, which would be cool for whole other reasons), is ask the framework (theatre) for corn, the framework is the one in charge of the source.
Yop ! Small question about jquery, there is a simple plugin to this ? (click on the logo M, there is a appearence of a menu ) medium.com/matter/88aa8a185898
There's a book called JavaScript: The Good Parts that will help you. Also, come to the JavaScript chat room once you hit 20 rep. That's how I learned (am learning) — RUJordan10 secs ago
@KrokosPro Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
looking at spin.js source code which is written in strict mode, and every variable declaration is without ";" at the end. For example: var prefixes = ['webkit', 'Moz', 'ms', 'O'], animations = {}, useCssAnimations So in strict mode ";" after variable declaration is not mandatory?
@light Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.