|
Jesus Christ, after digging for the first time in the underscore doc, I just realized that my whole team is currently working with a half-assed underscore written by one dude in the team. The only thing I'm unsure about is the promises pattern. He really fancies that a lot, and it looks like _.defer() is doing just that. Is that right?
|
# ¿ Sep 20, 2013 11:11 |
|
|
# ¿ Apr 23, 2024 20:12 |
|
Wheany posted:No. _.defer(someFunction) basically means window.setTimeout(someFunction, 0); Indeed, so I guess these mixins would do the trick?
|
# ¿ Sep 20, 2013 11:25 |
|
Knyteguy posted:What would be better to (re) invest my time into learning? Angular or Ember? I was checking out Ember fairly heavily at one point but I haven't kept up in the past few months. Ember and Angular are not the same thing. These slides explain it way better than I could.
|
# ¿ Dec 6, 2013 12:15 |
|
Angular question, related to the digest loop and bindings because I've no idea what I'm doing anymore. Basically the feature I'm working on is a translator panel. We've been using angular-translate and it does the work pretty well, but we need a way to display a panel containing all the translations requested on the current page, with input fields for each so the translators can fix typos and all, then save their work. Another request is to have a search field so the translator can easily find the string he's looking for. I solved that by copying the directive and filter shipping out with ng-translate, and make the filter call a service to add the requested translationKey to an object. Now, in my translator panel controller, I call the same service and ask him a list of all those translationKey's. Then, I load up both the EN and the current locale raw data (using a custom loader I plugged to angular-translate as well) and add them to the object. The end result looks like this : code:
code:
I assumed it was due to the fact that my controller code was pushing the "reference" and "value" strings one by one, so I now I push those in a temp object then I copy this temp object over the $scope binded value. Yet, I'm hitting the $digest loop limit, so I guess I'm still doing something terrible. There might be a better way to grab the collection of requested translation keys on the page, and there might also be a better way to add the reference/current value strings to the objects, but I'm an idiot.
|
# ¿ Feb 24, 2014 17:00 |
|
an skeleton posted:Got a question. I'm an intern at a local company and one of our goals this month is to get jasmine/karma testing online for one of our company's web applications this month. Problem is, the people who are supposed to help us are always busy and it doesn't seem like its gonna get done unless we do it ourselves. However I have no experience with unit testing and I'm feeling kinda intimidated by the whole idea, does anyone have any guidance for getting a jasmine/karma testing framework online for a large angular/jquery web app? If you're looking for end-to-end testing (testing user scenarios), check out Protractor. It's relatively easy to set up if you're already using NPM, and you can use Grunt/Gulp to run the test tasks for you.
|
# ¿ Mar 8, 2014 09:46 |
|
Womens Jeans posted:How do people feel about Dart? I've tried JS in the past and absolutely hated it. Dart + Polymer let me create a ridiculously nice website sending JSON objects to the backend with pretty much no hassle at all, and I feel as though it will be very easy to expand when the time comes. Dart is pretty much JS for people coming from non-web background. Polymer is basically the webdev future available today. As long as you're not trying to force down Dart onto someone, I see no reasons why you should refrain from using it.
|
# ¿ Mar 31, 2014 23:15 |
|
more like dICK posted:I was supposed to use Node.js and something called Bower to do this?? No you're not. Bower sometimes makes thing easier but if you don't feel like Bower would be a huge improvement to your workflow, there's no reason for you to switch to it. Get back on it later and see if you change your mind.
|
# ¿ Jun 21, 2014 01:19 |
|
Aren't Polymer components basically like directives on steroids? Our current project relies on Angular a lot and we should make more directives, but I'm wondering if Polymer components would not be a good thing.
|
# ¿ Jul 1, 2014 06:17 |
|
EVGA Longoria posted:In before "don't you mean bonus?" Sadly most of our customers don't give two poo poo about tech and probably use old Dell laptops they bought in the 1990s and never updated anything.
|
# ¿ Jul 7, 2014 07:16 |
|
fuf posted:I've been using angular and ngRoute to make very basic static sites. Basically my only logic is a list of routes like: Ember is amazing if you can fit the use case they invented it for, but it's a death trap if you wanna do anything else.
|
# ¿ Sep 4, 2014 15:30 |
|
Thermopyle posted:I'm whipping together a Django backend that exposes a CRUD RESTful API that has about a dozen models with various relations. The backend serves no HTML at all. IIRC you're already familiar with Angular, you might have missed Restangular that helps a ton when working with a RESTful API as the name suggests. I've got no idea how far the Ember team went on Ember Data (the binding-to-server-data part) but it was clearly the biggest flaw I could find last november when we were investigating the whole Single-Page-Application thing.
|
# ¿ Sep 9, 2014 20:57 |
|
SuicideSnowman posted:What's the best way to handle a somewhat large AngularJS application? I'm talking 20-30 controllers and the various services that would be attached to them. Not all of them need to be loaded at the same time, so I've been using require.js to load additional files as needed but I keep reading that using require.js with Angular is not the best idea. I'm also not sure having an index page that loads dozens of js files is the best option either. Get all your controllers and services in one single file, using automation tools like gulp-concat, gulp-ng-annotate and then gulp-uglify
|
# ¿ Oct 3, 2014 07:17 |
|
SuicideSnowman posted:Thanks for the advice. I've looked at this stuff in the past but it all seemed overwhelming so I never got far. Our current project has something like that. It's probably not the best way to do it but it works so far. code:
|
# ¿ Oct 3, 2014 10:50 |
|
Lumpy posted:I came across this during my morning coffee: https://medium.com/este-js-framework/whats-wrong-with-angular-js-97b0a787f903 I don't know, most of his points are hugely open for debate. For instance, you don't write logic in HTML, you write it in your services/controllers/directives. Likewise, his point about dirty checking is completely defeated by the Object.observe() API, which will be baked in Angular 2.0 IIRC. I mean sure, Angular have its pain points and weaknesses but the speed argument aside, this article doesn't cover any. Basically, it sounds like someone who's in love with another lib/tech/stack who briefly tried Angular or read a random tutorial/the documentation and came up with a rebuttal.
|
# ¿ Oct 7, 2014 15:11 |
|
Whalley posted:I'm kind of a newbie developer, I've had at most a week's worth of experience with Angular and I already know there's issues with what he's said. Like, point number one is literally "wah wah I only like to code this way" and point four is... what? If you're making or changing a feature, you have to change the code? Then he starts complaining about dirty checking as if it wasn't already something that is being fixed. Hell, for low amounts of callbacks/low numbers, dirty checking seems way nicer than having to deal with accessors. Actually they use Angular in production for the DoubleClick Campaign Manager. It may be not as public-facing as Gmail but I don't think that Google consider its advertisement platform to be something of a side project.
|
# ¿ Oct 7, 2014 17:08 |
|
Kobayashi posted:Ember just announced its roadmap for v2.0. I love Ember, but I only write toy apps so I'm not really qualified to preach. Still, I like their "pave the cowpaths" approach to adding features. I also like how the tooling and documentation are integral parts of the development cycle, and their commitment to minimizing breaking changes. The TL;DR seems to be "aping cool features from React, avoiding the Angular 2.0 clusterfuck." I think there's a lot of debate regarding the Angular 2.0 syntax presented at ng-europe, they might actually make it much less confusing and esoteric.
|
# ¿ Nov 4, 2014 08:24 |
|
TildeATH posted:Webdevs have been making a CLI cargo cult for a while now. Annoying how people who do UI/UX/HCI can't implement those principles in their own tools. Yeah, and you hear quotes like Stephen Hay's "Learn to love the command line. It isn’t scary. You know how to use Photoshop which has 300 buttons. That’s scary." all the time. What they fail to mention is that Photoshop makes discovering what those buttons do easy and painless (thanks to the undo). Not to mention that most of that CLI Cult is pushing people to develop tools saying "unix only" and gently caress that poo poo. The Internet hasn't been built to be "unix only".
|
# ¿ Feb 24, 2015 17:26 |
|
more like dICK posted:This is specifically not true anymore. The last presentations from the Angular 2.0 team have indicated that there will be a migration path involving incremental changes to move a 1.x app to 2.x. No more upfront total rewrite. To extend on your point : quote:We’ll continue building releases in the Angular 1 branch until the vast majority of folks have moved to Angular 2. We want the burden to be on the Angular team to make Angular 2 simple to learn, attractive in its features, and an easy target to migrate to from Angular 1. Taken straight from the official announcement after NG-Conf.
|
# ¿ Mar 11, 2015 10:06 |
|
I must be in full-blown Stockholm syndrome right now because I'm considering switching from JSHint to ESLint and I'm about to do that in the project's Gulpfile. Related question: You guys think the ES6 modules could help us un-gently caress front-end dev a tiny bit? I'm on the fence about using that plus Babel or Traceur to make that poo poo slightly retro-compatible.
|
# ¿ Apr 8, 2015 07:14 |
|
I work on Windows, mostly with Sublime Text + a git-bash window wrapped in Console, and I'm not really encountering any major issue. I'm also trying out WebStorm at work right now and I have to admit I really like it. If my new work (I switch early may) doesn't have strong feelings about one or the other, I'll probably buy myself a licence.
|
# ¿ Apr 9, 2015 18:37 |
|
Skandranon posted:I had a lot of luck with NG-Book (Amazon or filez), it did a good job of explaining things and had good examples. The 1.x -> 2.0 route isn't as uncertain as it used to be, the Angular team recently announced there should be a smooth upgrade path, and they have definite plans up to 1.5, and probably more after that. Once you get how Angular wants you to structure your code, it makes a lot more sense and you feel like you aren't fumbling around so much. Directives are tough, but you get them eventually if you keep at it. Seconding ng-book, also check out this styleguide.
|
# ¿ Apr 20, 2015 22:43 |
|
|
# ¿ Apr 23, 2024 20:12 |
|
mpaarating posted:I also like the Todd Motto style guide. John Papa and him are pals and each one have a link to the other's guide at the top of the page, I used John Papa's guide at my last job so I thought it would be enough to link his. You're 100% right to also recommend Todd Motto's guide ofc. If you want to be a pain in the rear end of your colleague who's writing code like there's no tomorrow, there's an ESLint plugin that checks for some of John Papa's rules.
|
# ¿ Apr 21, 2015 07:10 |