|
an skeleton posted:I have a question. I'm a novice developer (been seriously developing for about a year or so) and I am finally feeling pretty proficient in AngularJS (I still kinda suck at creating directives from scratch but whatever). I kind of have the itch to learn a new JavaScript framework, I was thinking Backbone or Ember. However, I have 2 questions. 1) Absolutely. You'll see different solutions to similar problems, which means your brain will have more ideas to draw from. 2) Everything, as I really don't like Angular. That is a personal thing though, as I know Angualr is a perfectly capable framework, it just has a different opinion on where and how things get done than I do. I second Thermopyle's recommendation to look at React. For fun, learn Ampersand (https://ampersandjs.com) as well. It's a different take on Backbone, and looks pretty interesting.
|
# ? Jan 7, 2015 13:47 |
|
|
# ? Apr 28, 2024 14:29 |
|
If nothing else, learn Backbone for the tiny, heavily commented and very understandable codebase, it's a good codebase to read. It's not a complicated framework at all (effectively just a collection of helper methods), and you can pick it up very quickly. Also, it is easy to pair it (replacing Backbone views) with the equally non-complex React (or Ractive, for that matter).
|
# ? Jan 7, 2015 20:15 |
|
Lumpy posted:I second Thermopyle's recommendation to look at React. For fun, learn Ampersand (https://ampersandjs.com) as well. It's a different take on Backbone, and looks pretty interesting. Thirding this! Ampersand is a really neat framework, and I'm gonna move onto it next once I'm satisfied putzing around with React. I really think that front-end developers have to be familiar with a bunch of different frameworks, because the state of technology in the field changes fast and you have to adapt to survive. I think wraithgar works on Ampersand, if they're around...
|
# ? Jan 9, 2015 00:52 |
|
Thermopyle posted:It kinda depends on your goal. I just started using Angular for a project, and while it is pretty neat from a whiz-bang databinding perspective, I gotta say it's bloated as gently caress. The amount of loving garbage that you have to deal with is sort of ridiculous.
|
# ? Jan 9, 2015 02:35 |
|
This is less a "newbie" question and more a "I have no idea what this poo poo is" question. How does the database fit into this whole front-end framework thing? All the overviews I read about AngularJS (for instance) keep mentionaing JSON files. But where does, say, a mysql database fit into the picture? Do these frameworks function in lieu of a traditional relational database? Or is getting the database formatted into JSON data just one of the back-end steps required for these frameworks?
|
# ? Jan 9, 2015 17:16 |
|
caiman posted:This is less a "newbie" question and more a "I have no idea what this poo poo is" question. How does the database fit into this whole front-end framework thing? All the overviews I read about AngularJS (for instance) keep mentionaing JSON files. But where does, say, a mysql database fit into the picture? Do these frameworks function in lieu of a traditional relational database? Or is getting the database formatted into JSON data just one of the back-end steps required for these frameworks? Usually there's some sort of web service or REST service in between your app and the database itself. Ostensibly your service returns JSON. The app I work on at work does it this way. With a DB2 *shudder* back end. There's a Java web service which the app hits via Angular $resource.
|
# ? Jan 9, 2015 17:20 |
|
caiman posted:This is less a "newbie" question and more a "I have no idea what this poo poo is" question. How does the database fit into this whole front-end framework thing? All the overviews I read about AngularJS (for instance) keep mentionaing JSON files. But where does, say, a mysql database fit into the picture? Do these frameworks function in lieu of a traditional relational database? Or is getting the database formatted into JSON data just one of the back-end steps required for these frameworks? It doesn't matter! It could be a static JSON file stored on a hard drive, or a REST server that queries a database, then transforms the output into JSON format. The client only cares if the JSON is well-formed and contains the necessary data. quote:Or is getting the database formatted into JSON data just one of the back-end steps required for these frameworks? Usually there is a whole separate framework (like Ruby on Rails or Django or Laravel) that deals with generating API results.
|
# ? Jan 9, 2015 18:08 |
|
So are CRUD operations common in an average Angular application? Or is that not what it's intended for?
|
# ? Jan 9, 2015 18:28 |
|
caiman posted:So are CRUD operations common in an average Angular application? Or is that not what it's intended for?
|
# ? Jan 9, 2015 20:22 |
|
One big thing to remember is that most Single Page Applications (React, Angular, whatever) will still have a backend somewhere. That backend won't be fully featured usually but it's still where you go if you want some user data or whatever.
|
# ? Jan 10, 2015 00:16 |
|
NovemberMike posted:One big thing to remember is that most Single Page Applications (React, Angular, whatever) will still have a backend somewhere. That backend won't be fully featured usually but it's still where you go if you want some user data or whatever.
|
# ? Jan 10, 2015 03:19 |
|
caiman posted:So are CRUD operations common in an average Angular application? Or is that not what it's intended for? Old way: browser sends POST request. Server does server things and assembles and returns a bigass new HTML page. New way: javascript framework sends POST request. Server does server things and returns a smallish amount of JSON.
|
# ? Jan 10, 2015 07:25 |
|
caiman posted:So are CRUD operations common in an average Angular application? Or is that not what it's intended for? If you want to dive in new backends a bit, get Yeoman and generate an app using angular-fullstack. It has an Express backend that talks to a MongoDB database. It's kind of the Javascript hipster equivalent to a php/mysql server. You can use other backends like PHP or ASP.NET, but this is stack is pretty popular nowadays. With a NoSQL database like Mongo the idea is that your JSON document is your datarow and your primary key is a GUID. You could certainly go with a relational model and put together JSON from the result of a SQL query if your app benefits from that kind of system. For many apps it simply doesn't matter and you just want to store some poo poo on a server and don't want to deal with managing schema or other bullshit.
|
# ? Jan 10, 2015 09:04 |
|
Tres Burritos posted:I just started using Angular for a project, and while it is pretty neat from a whiz-bang databinding perspective, I gotta say it's bloated as gently caress. The amount of loving garbage that you have to deal with is sort of ridiculous. What do you mean? The only garbage that I've found is the relatively verbose boilerplate for setting up new directives...overall it absolutely blows my mind how much angular accomplishes with just a few lines of code... Wrt to back end frameworks, some goons recommended SailsJS to me in the other thread. It's still a WiP and there are bugs and missing features. At the same time, you can declaratively describe your data model in 10 lines and the thing will spit out REST endpoints and server-side JS bindings to a backing DB of your choice.
|
# ? Jan 10, 2015 09:21 |
|
shodanjr_gr posted:What do you mean? The only garbage that I've found is the relatively verbose boilerplate for setting up new directives...overall it absolutely blows my mind how much angular accomplishes with just a few lines of code... ...that you see. For basic stuff and CRUD, it's pretty simple, but if you want anything more complicated than that, then you have to create your own directives, which means you then have to read up on how Angular expects you to program modules and organize your project, and then that means you've touched the surface of the documentation and you figure "hey this can't be that bad" and no it is that bad it is really that bad. Backbone might take more typing overall, but I found that I actually knew what the gently caress was going on when I used it. Unlike in Angular. Also, gently caress compiling glompix posted:With a NoSQL database like Mongo the idea is that your JSON document is your datarow and your primary key is a GUID. This...is a lot less horrible than I thought. I expected Mongo to be some complicated monstrosity, not just what's basically a GUID version of a Javascript array. I might have to look into this.
|
# ? Jan 10, 2015 15:07 |
|
Misogynist posted:The backend will be completely full-featured, it just won't render full HTML pages whenever you click a button. It's more helpful to think of the difference in the interaction model being at the client end, not the server end. The server can still do whatever it wants. I meant not fully featured in the MVC sense. When you have a single page application you stop needing the templating and everything that the View layer has, so you end up with a very simplified system. The bulk of what you care about is in the model and the controller simply does routing and possibly some transformations. There are even frameworks now that focus on acting as RESTful interfaces and are simplified/specialized compared to fully featured frameworks.
|
# ? Jan 10, 2015 17:47 |
|
Pollyanna posted:...that you see. For basic stuff and CRUD, it's pretty simple, but if you want anything more complicated than that, then you have to create your own directives, which means you then have to read up on how Angular expects you to program modules and organize your project, and then that means you've touched the surface of the documentation and you figure "hey this can't be that bad" and no it is that bad it is really that bad.
|
# ? Jan 10, 2015 22:05 |
|
I agree that Angular has major problems. I just started developing with it a couple months ago, before that I used Backbone, Knockout, or just plain old JavaScript for many years. Here's a great article that references many of the problems: https://medium.com/@mnemon1ck/why-you-should-not-use-angularjs-1df5ddf6fc99 Basically:
|
# ? Jan 11, 2015 16:58 |
|
sim posted:[*] two-way data binding is slow, makes data flow complex, and has hard limits (2k watchers) quote:[*] string based dependency injection breaks on minification quote:[*] errors in templates don't fire, which might be ok except... quote:[*] scope inheritance is complicated Okay yes, some of the stuff needs to be more intuitive, but it feels like guys who wrote those links just gave up before getting used to the thing. pigdog fucked around with this message at 18:50 on Jan 11, 2015 |
# ? Jan 11, 2015 18:48 |
|
NovemberMike posted:I meant not fully featured in the MVC sense. When you have a single page application you stop needing the templating and everything that the View layer has, so you end up with a very simplified system. The bulk of what you care about is in the model and the controller simply does routing and possibly some transformations. There are even frameworks now that focus on acting as RESTful interfaces and are simplified/specialized compared to fully featured frameworks. I mean, that's totally true of small apps and internal things where you don't need search engine visibility. But for decent performance on apps of reasonable complexity, and for SEO, you're still going to be doing a good amount of server-side rendering. Here's a piece from Twitter on why they moved back to server-side rendering and progressively enhancing the content experience on the client side: https://blog.twitter.com/2012/improving-performance-on-twittercom
|
# ? Jan 11, 2015 21:52 |
|
pigdog posted:Which is why every Angular guide and official documentation strongly encourages using array syntax which doesn't break. There's even a grunt task that will change it to use the array syntax before minification, so you if you use that you don't even have to worry about it.
|
# ? Jan 11, 2015 22:59 |
|
Misogynist posted:It depends? I know this. I was answering a question for someone that wanted to know where CRUD went in an Angular app. There's some cool stuff with isomorphic React/Flux applications that execute the same code on the server and client as well, but that's not helping anyone with a basic Angular app.
|
# ? Jan 12, 2015 01:20 |
|
sim posted:I agree that Angular has major problems. I just started developing with it a couple months ago, before that I used Backbone, Knockout, or just plain old JavaScript for many years. Here's a great article that references many of the problems: https://medium.com/@mnemon1ck/why-you-should-not-use-angularjs-1df5ddf6fc99 That Medium article reads like a typical complaint with Angular. In short: "I design/code/do things this way, and am not willing to change my way, so Angular sucks because it doesn't do my way well." In which case my response is also typical: "don't use Angular, then." The guy who spent 2 years on Angular has a few valid complaints, but I'm guessing two years with ANY library would result in an equal number. Angular is not the end-all, be-all - neither is any other library. We looked at a lot of frameworks before doing the project we started a year ago at work, and Angular / Ionic turned out to be the best tool for our specific situation. Would I recommend it for another project? Maybe? Depends on the project. Like it always should. But good lord - it's javascript. There are a million freaking ways to accomplish a task, so if you don't see one you like - write it? As a semi-aside: I have never understood evangelizing for or against ANY library/language/framework. It has always struck me as the weirdest possible place for dogma to appear. If it doesn't do what you want it to do, then use something else? If there isn't anything which does exactly what you want it to do, either write it, or re-think your design. Thankfully this thread has been mostly free from this idea, but it's always weird to see someone writing an article which describes them doing the programming equivalent of holding a hammer and complaining that the hammer sucks because everything isn't a nail.
|
# ? Jan 12, 2015 13:18 |
|
HaB posted:The guy who spent 2 years on Angular has a few valid complaints, but I'm guessing two years with ANY library would result in an equal number. Angular is not the end-all, be-all - neither is any other library. We looked at a lot of frameworks before doing the project we started a year ago at work, and Angular / Ionic turned out to be the best tool for our specific situation. Would I recommend it for another project? Maybe? Depends on the project. Like it always should. I agree, 100%. I'm also building an app with Angular / Ionic and if I had to start over, I would still pick Angular / Ionic. Angular is great for what it does. I think the people who complain about it are just venting frustrations and playing devil's advocate to all the complimentary articles and seemingly endless praise. I find their tear downs useful for planning around Angular's shortcomings.
|
# ? Jan 12, 2015 16:38 |
|
Ember question: I want to show an InfoWindow when a user clicks a Google map marker. I have a class for the map markers, they seem to work fine, their positions and visibility and all that update automatically when the underlying Ember-object changes. But for the InfoWindow, I need a HTML text. Apparently there isn't a way to render a template file to string, then set that as the contentString of the InfoWindow. You can call Ember.Handlebars.compile to compile a template, but you need a template string for that. Now I can just supply it with a template in JS code, but that kind of defeats the point of having template files. Can I render a template file to a string and if so, how?
|
# ? Jan 12, 2015 18:35 |
|
Wheany posted:But for the InfoWindow, I need a HTML text. I don't work with Google Maps, but I would be surprised if Google didn't let you pass in a DOM node, instead of an HTML string.
|
# ? Jan 12, 2015 19:29 |
|
bartkusa posted:I don't work with Google Maps, but I would be surprised if Google didn't let you pass in a DOM node, instead of an HTML string. From what I've used of Google Maps, it expects DOM nodes, rather than HTML strings. edit: Ooh, wait, this is for InfoWindow. I haven't tackled those yet (but soon!), so I don't know how it treats them. Pollyanna fucked around with this message at 19:44 on Jan 12, 2015 |
# ? Jan 12, 2015 19:41 |
|
Wheany posted:Ember question: Here's a jsbin I threw together.
|
# ? Jan 12, 2015 20:21 |
|
HaB posted:As a semi-aside: I have never understood evangelizing for or against ANY library/language/framework. It has always struck me as the weirdest possible place for dogma to appear. If it doesn't do what you want it to do, then use something else? If there isn't anything which does exactly what you want it to do, either write it, or re-think your design. Thankfully this thread has been mostly free from this idea, but it's always weird to see someone writing an article which describes them doing the programming equivalent of holding a hammer and complaining that the hammer sucks because everything isn't a nail. This seems to be a pretty common thing when it comes to AngularJS I've noticed. I've read so many "DON'T USE ANGULARJS" blogs I've lost count. I've been working on an application over the past year at my job that's extremely form heavy and requires a lot of pulling and sending data while constantly updating the page to reflect this data. Angular has made it a joy to create as opposed to a headache. In fact the only headaches I've had have been trying to wrestle with the different browsers to make sure they're all acting similarly but that's a problem every web dev faces. In the future I wouldn't be opposed to trying some of the other popular frameworks but it wouldn't be because Angular has failed me in some way.
|
# ? Jan 13, 2015 03:53 |
|
I hate to be "that guy" but I'm really desperate for some kind of guide that will give a clear overview of directives in AngularJS. I've read the OP which linked to a site that looks promising, except that the tutorials are all in video form and several are behind a paywall. I really need something that addresses things within the context of a medium-complexity app, something more than a todo-list and something less than a Gmail. I'll describe the primary conceptual issue I'm having at the moment - bearing in mind I'm very new to AngularJS (but not to JS itself): Say I have a SPA that needs to track a couple of different lists, such as a list of notes and a list of user profiles: code:
code:
I don't really need a step-by-step walkthrough, but I'd love it if anyone has some tutorials or something that cover some of these more complicated aspects of directives. As many have already mentioned (here and everywhere else) the docs are next to useless for any kind of real-world work.
|
# ? Jan 19, 2015 03:07 |
|
https://docs.angularjs.org/guide/directive Read the section titled: Isolating the Scope of a Directive You can pass an object to a directive with an attribute: code:
code:
|
# ? Jan 19, 2015 04:51 |
|
SuicideSnowman posted:https://docs.angularjs.org/guide/directive You are a legend, this was exactly that little fragment of detail I needed to complete the picture! Much appreciated, I'll read more carefully in future.
|
# ? Jan 19, 2015 06:05 |
|
Sedro posted:You can bind a view's template name to a property on your controller/model. I'm just going to steal all the codes. Thank you.
|
# ? Jan 19, 2015 11:53 |
|
Wheany posted:I'm just going to steal all the codes. Thank you. Just adopting that ended up being a billion times better than the poo poo we had before. Now there is some sense of structure in the google maps code.
|
# ? Jan 19, 2015 19:39 |
|
Cool, I'm glad that helped.
|
# ? Jan 19, 2015 20:20 |
|
Angular ui-router question from someone who clearly has no idea what's going on. So I'm working on a project for a client who has insisted that we use Angular because the dev that will be maintaining the project is "familiar" with it. There are 2 basic layouts the project can have, as shown below - Based on role, settings, whatever, any one of these content blocks can be filled by any number of things. We aren't looking to have re positioning yet, but that may happen down the line. So I looked at this angular routing demo to see if it would suit my needs: https://scotch.io/tutorials/angular-routing-using-ui-router and I'm having a bit of trouble with all the potential nesting going on. I have a master layout page that has this: code:
code:
code:
I started to writeup my router like the demo and realized i have no idea how to inject the route-ception here
|
# ? Jan 21, 2015 15:48 |
|
So I finally jumped into MVC and built a small app with Ember and Ember-CLI but, I don't know, it just seems too over engineered to me. I don't work on a big team, and for some reason I don't like the jQuery dependency and so I'm going to play around with React, which looks interesting. I'm a little leery of JSX, though, and prefer writing out the vanilla JavaScript. Does that make sense?
|
# ? Jan 22, 2015 18:09 |
|
TildeATH posted:So I finally jumped into MVC and built a small app with Ember and Ember-CLI but, I don't know, it just seems too over engineered to me. I don't work on a big team, and for some reason I don't like the jQuery dependency and so I'm going to play around with React, which looks interesting. I'm a little leery of JSX, though, and prefer writing out the vanilla JavaScript. Does that make sense? Sure, but JSX is pretty nice. Doing it in plain JS is certainly doable, but I've found JSX has grown on me quite a bit. Doesn't add any additional pains with jsx -w src/ dest so at least give it a try before dismissing it. React is really, really nice.
|
# ? Jan 22, 2015 18:48 |
|
TildeATH posted:I'm a little leery of JSX, though, and prefer writing out the vanilla JavaScript. Does that make sense? JSX gets transformed to vanilla JS under the covers: http://facebook.github.io/react/docs/jsx-in-depth.html . In most circumstances, no, I don't think JSX is worth eshewing. The code is quite succinct, and I don't feel like the generated code is worth worrying about.
|
# ? Jan 22, 2015 18:54 |
|
|
# ? Apr 28, 2024 14:29 |
|
TildeATH posted:So I finally jumped into MVC and built a small app with Ember and Ember-CLI but, I don't know, it just seems too over engineered to me. I don't work on a big team, and for some reason I don't like the jQuery dependency and so I'm going to play around with React, which looks interesting. I'm a little leery of JSX, though, and prefer writing out the vanilla JavaScript. Does that make sense? Not that you shouldn't play around with other frameworks, but removing jQuery as a dependency is on the Ember roadmap: quote:Once we move over to HTMLBars, the interaction between Ember.js and the DOM gets smaller. We can probably treat jQuery as an optional dependency and only use it if it is available via globals or as an AMD module. We just want to make sure that we remove components/views using jQuery if its available so that jQuery UI widgets that have stored data in the DOM via jQuery.data() get cleaned up appropriately. (The HTMLBars thing took a lot longer than they thought it would.)
|
# ? Jan 22, 2015 18:58 |