Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

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) Is there a real plus to learning to different frameworks or should I just keep at one and if I ever have a serious need for the other, switch over?

2) What would you use Backbone for that you wouldn't use Angular for? Like is there a specific type of application that just screams Backbone? (ditto for Ember, I guess)

Of course the real answer to my question 1 is "just do it and find out you dickhead, you're still a newb" but I'd rather listen to internet strangers' theories. Thanks!

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.

Adbot
ADBOT LOVES YOU

RobertKerans
Aug 25, 2006

There is a heppy lend
Fur, fur aw-a-a-ay.

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

Pollyanna
Mar 5, 2005

Milk's on them.


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...

Tres Burritos
Sep 3, 2009

Thermopyle posted:

It kinda depends on your goal.

If you're wanting to expand your ways of thinking about the problems we encounter, I'd recommend learning React. Particularly because it's got a small API and you can read all the docs in one sitting, so it's not like you're devoting a big chunk of your life to it.

Really, the more you learn, the more tools you have to solve problems you encounter. They're all good to be familiar with.

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.

Spatulater bro!
Aug 19, 2003

Punch! Punch! Punch!

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?

HaB
Jan 5, 2001

What are the odds?

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.

Stoph
Mar 19, 2006

Give a hug - save a life.

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.

Spatulater bro!
Aug 19, 2003

Punch! Punch! Punch!

So are CRUD operations common in an average Angular application? Or is that not what it's intended for?

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.

caiman posted:

So are CRUD operations common in an average Angular application? Or is that not what it's intended for?
Sure, but they're handled by a backend REST API via XHR. You don't do a full-page refresh the way that you would in, say, a Django or Rails app that only renders static pages.

NovemberMike
Dec 28, 2008

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.

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.

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.
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.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

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.

glompix
Jan 19, 2004

propane grill-pilled

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.

shodanjr_gr
Nov 20, 2007

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.

Pollyanna
Mar 5, 2005

Milk's on them.


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 :shepicide:

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.

NovemberMike
Dec 28, 2008

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.

shodanjr_gr
Nov 20, 2007

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.

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 :shepicide:
I haven't worked with angular a lot (started a couple of weeks ago) but I've gone through the process of writing directives and I can't say that I've had much trouble...although i do agree that how everything comes together is basically a black box for me at this time and the "advanced" docs do assume that you have a complete understanding of the templating process..

sim
Sep 24, 2003

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:
  • two-way data binding is slow, makes data flow complex, and has hard limits (2k watchers)
  • string based dependency injection breaks on minification
  • errors in templates don't fire, which might be ok except...
  • logic is in your HTML
  • scope inheritance is complicated
  • directive methods are complicated
  • terrible documentation
There's also this article: http://www.fse.guru/2-years-with-angular, which talks about similar but different issues with Angular. The author only recommends it for prototypes, or very basic CRUD applications.

pigdog
Apr 23, 2004

by Smythe

sim posted:

[*] two-way data binding is slow, makes data flow complex, and has hard limits (2k watchers)
There's no such "hard limit" as far as I know. If you have 2k watchers then that's a pretty complex webpage, but that's not Angular's fault. There are plenty of ways to optimize if you really start running into performance problems. Using ::stuff one-way binding and ng-hide instead of ng-if, things like that.

quote:

[*] string based dependency injection breaks on minification
Which is why every Angular guide and official documentation strongly encourages using array syntax which doesn't break.

quote:

[*] errors in templates don't fire, which might be ok except...
[*] logic is in your HTML
View code is in your HTML which is kind of the point.

quote:

[*] scope inheritance is complicated
[*] directive methods are complicated
[*] terrible documentation
:negative:

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

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.

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.
It depends?

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

glompix
Jan 19, 2004

propane grill-pilled

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.

NovemberMike
Dec 28, 2008

Misogynist posted:

It depends?

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

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.

HaB
Jan 5, 2001

What are the odds?

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

Basically:
  • two-way data binding is slow, makes data flow complex, and has hard limits (2k watchers)
  • string based dependency injection breaks on minification
  • errors in templates don't fire, which might be ok except...
  • logic is in your HTML
  • scope inheritance is complicated
  • directive methods are complicated
  • terrible documentation
There's also this article: http://www.fse.guru/2-years-with-angular, which talks about similar but different issues with Angular. The author only recommends it for prototypes, or very basic CRUD applications.

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.

sim
Sep 24, 2003

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.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
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?

bartkusa
Sep 25, 2005

Air, Fire, Earth, Hope

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.

Pollyanna
Mar 5, 2005

Milk's on them.


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

Sedro
Dec 31, 2008

Wheany posted:

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?
You can bind a view's template name to a property on your controller/model.

Here's a jsbin I threw together.

SuicideSnowman
Jul 26, 2003

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.

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION
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:
var userProfiles = [
    {
        id: 1,
        given: 'John',
        surname: 'Doe',
        username: 'jdoe'
    },
    {
        id: 2,
        given: 'Richard',
        surname: 'Kyanka',
        username: 'lowtax'
    }
];

var notes = [
    {
        id: 1,
        title: 'A note',
        content: 'This is a note!'
    },
    {
        id: 2,
        title: 'Another note',
        content: 'This is a second note!'
    }
];
Now, I might have a couple of different ways I want to use this data - I might want to take the user profiles and show them in a list, while also showing them in a dropdown for one user to add another user to friends (or whatever, the specific case doesn't matter). So I might have a directive that can be used to generate a nice list when given a JavaScript dataset. I might then make a second directive that can provide a dropdown list for a given JavaScript dataset. I would then add both of these to the page, wire them both up to the userProfiles variable somehow and away we go. The problem is there'll be some things within the scopes of those directives that will need to be isolated from the parent scope. This is where things get tricky. I get that this:

code:
var app = angular.module('myApp');
app.controller('AppCtrl', ['$scope', function ($scope) {
    $scope.userProfiles = [
        ...
        ...
        ...
    ];
}]);
app.directive('myDirective', function () {
    return {
        scope: {
            items: [
                ...
                ...
                ...
            ]
        }
    };
});
Will give me an isolated scope, so that I can just list "items" in the view and each use of the directive will have its own list - but then how would I access the userProfiles list in the parent view? I need to pass that through to the directive somehow but I'm not sure how this is supposed to work. I guess I would use an attribute to define the dataset or something but I'm a bit stuck on how to do this.

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.

SuicideSnowman
Jul 26, 2003
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:
<my-directive users="userProfiles"></my-directive>
Then in the directive:

code:
return {
    scope: { users: '=' }
}
Then you should be able to access the userProfiles in the directive via 'users' just like you would access userProfiles in app controller.

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION

SuicideSnowman posted:

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:
<my-directive users="userProfiles"></my-directive>
Then in the directive:

code:
return {
    scope: { users: '=' }
}
Then you should be able to access the userProfiles in the directive via 'users' just like you would access userProfiles in app controller.

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.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Sedro posted:

You can bind a view's template name to a property on your controller/model.

Here's a jsbin I threw together.

I'm just going to steal all the codes. Thank you.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

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.

Sedro
Dec 31, 2008
Cool, I'm glad that helped.

aBagorn
Aug 26, 2004
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:
<div class="container">

    <div ui-view></div>

</div>
Next layer down i have two different layout templates (is that the right word?) the 1x3 and the fullpage, respectively:

code:
<div class="jumbotron">
      <div ui-view="" class="container-fluid">
      </div>
</div>

<div class="container-fluid">
    <div class="row">
        <div class="col-lg-4 smallpanel">
            <div ui-view="" class="panel-content" >

            </div>
        </div>
        <div class="col-lg-4 smallpanel">
            <div ui-view="" class="panel-content">

            </div>
        </div>
        <div class="col-lg-4 smallpanel">
            <div ui-view="" class="panel-content">

            </div>
        </div>
    </div>
</div>
code:
<div ui-view="">

</div>
and then, third layer down, I have the content blocks themselves.

I started to writeup my router like the demo and realized i have no idea how to inject the route-ception here

TildeATH
Oct 21, 2010

by Lowtax
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?

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

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.

bartkusa
Sep 25, 2005

Air, Fire, Earth, Hope

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.

Adbot
ADBOT LOVES YOU

Kobayashi
Aug 13, 2004

by Nyc_Tattoo

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

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply