Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

JohnRivs's avatar

Which of these is you favorite JS framework to use with Laravel?

Angular, Backbone, Knockout and Ember.

Which of those have you tried? Do you use it for large apps? Small apps? Heavy API based apps? Any particular reason for using that instead of any other? Would you use more than one together?

0 likes
49 replies
henrique's avatar

I used Knockout for a small project because it looked pretty easy to get started (and it was :D).

Now I'm learning Angular to use on other apps because I use Zurb Foundation (similar to Twitter Bootstrap) and they are making a version for web apps that will use Angular as it's JS framework and also because it looks very featurefull (if that is even a word).

1 like
Philo's avatar

I'm using Angular, works the best out of the box I think.

pobble's avatar

I've been using Angular. But I don't think it's for the feint hearted or the inexperienced Javascript developer. The learning curve is fairly high and the (improving) documentation is very technical.

I absolutely love the idea of using the DOM as your template, the idea of controllers and the path of good organisation it leads you down.

However, I do constantly look at my code and wonder if I'm doing things the right way or could I just do things better. I'm usually very good at not optimising things too early but Angular has that effect on me.

Well worth learning if you have the time.

1 like
psmail's avatar

As @pobble said, I don't think it is for the faint hearted. I found it difficult to pass values to and between Angular views. If anyone tute for me to help me get my head around it, I'll take it.

In the meantime, I use Backbone for two reasons - it is fairly easy to understand and loads of sites use it. Yes, there is lots of boilerplate, but I imagine it could be wrapped up in some custom, reusable code to circumvent a lot of that.

1 like
chrismichaels84's avatar

I prefer ember.js. I'm not a front-end guy, and Angular seems to get too far away from the javascript that I know. Ember is clean and simple and very fully features. Plus, the community has a great selection of plugins. This may be true for Angular as well, I don't know.

mikebronner's avatar

Using vanilla jQuery at the moment, interested in looking into Angular or something similar down the road, though.

NormySan's avatar

I've not used anything other than Angular, i did look trough a lot of code examples and tutorials before i decided on going with Angular tough.

I choose angular because i love how it's done and how well it integrates with the html. And t just keeps getting better with each release.

1 like
SP1966's avatar

@psmail You should use a service for passing data between views and/or controllers.

The learning curve for Angular can tend to be steep, but also uneven. Just as you think you're getting the hang of it you run into the next layer of complexity. Persevere, the payoff is great if you make it to the end!!

bagwaa's avatar

AngularJS, but I am interested in taking a peek at knockout, I did use backbone for a while, but just didn't feel that great to me, probably because I needed to learn more about it.

CraftThatBlock's avatar

I personally use Angular, but I haven't really tested out the others just yet :P

psmail's avatar

Oh ... @JohnRivs ... Facebook's React is another framework that is getting traction.

And in relation to combining frameworks, I think Backbone and React can indeed be used in conjunction with another framework. Indeed, the framework Knockback combines Knockback binding with Backbone.

@SP1966 - yeah ... Not sure that's going to make the light go on for me.

kolyaxil's avatar

I didn't started using it properly but I think if I will start I use angular.js.

psmail's avatar

@SP1966 ... see ... that's more like it :) I'll check out the link and take a broader look at egg head. Thanks.

1 like
cconey's avatar

I have had some success with integrating Angular into my normal Laravel workflow.

nolros's avatar

I've been porting my JS / JQuery to AngularJS for the past 6 months to a singlepage Angular / Laravel app. What I thought was going to be a month's worth of work turned into a 6+ month vertical learning curve. I had to go back to the JS books.

It's the MVC framework for JS, but very different from many JS and MVC frameworks other than maybe Mustache, as it "compiles" HTML and therefore demands a very strict coding practice i.e. services, routes, views, etc. If you come from a C or any OOP background you will really like Angular and even then you will probably not like the DOM backbone approach. If you don't come from an OOP backgroud, but instead, a JQuery or intermediate JS background you are going to be very lost in the first couple of months. The word a seasoned friend of mine used last week was "reeling".

I'm about a week or two away from finishing the port of my authentication and form validation to Angular JS / Laravel e.g. validate field in Angular (very powerful) and then further validation with Laravel. The two combined really kick ass, but you cannot use blade template engine as it screws around with core compile concept ... in my case I ended up with screen flickering. Same goes for JQuery libraries like Datepicker, etc. I've had to write http interceptors for http header response, injection and error handling of 2xx, 4xx and 5xx Laravel http codes.

I'm finally at the point of where I'm starting to "enjoy" Angular, but will warn you that for the first 3 months I hated it and there were a number of occasions where I threw in the towel, but found myself returning every time I wrote some crappy JS code. Compared to Laravel where I loved it the first week.

3 likes
jgravois's avatar

I use AngularJS (use Laravel for Authentication and persistence) but EmberJS looks like something I would like to learn as well ... LOL, not that you need two JS frameworks in your toolbelt, but ...

jeffhertzler's avatar

I've used both Angular and Ember in production apps. If I get to start a project from scratch I choose Ember. The conventions are awesome and really help keep your code organized. The router is fantastic. Ember-CLI is also super awesome. You should check it out if you haven't.

Angular tends to get messy quickly if you aren't super careful. Having said that, if I have views on a server side app that need more complex JS than just some light jQuery, I'll use Angular in those situations. That's worked out great for me as well.

lossendae's avatar

I use jQuery at work, because I'm not the only one developpers and the others are not too fond of JS altogether.

I used ExtJs a lot before, but now, my personnal favorite is AngularJS despite the fact that I don't use it on a daily basis.

I've made a few project with it, and I absolutely love the two way binding and html extension. @nolros You can use blade with angular, just put @ before the tag that the blade engine should ignore (eg : @{{ yourVar }}).

niallobrien's avatar

I'm using Angular at the moment for numerous reasons, one being mobile. By using Laravel, node.js or Firebase for a backend API, I can develop desktop (node-webkit), web & mobile apps using Angular (Ionic Framework on mobile). That alone is worth it in my opinion.

erikthedeveloper's avatar

I am currently in the early phases of several Ember.js/Laravel projects (fairly large scale).

My thoughts on Ember.js? Absolutely loving it thus far.

I've spent some time with both Ember and Angular (mostly experimental projects to decide which framework to pursue further) and I have just gravitated towards Ember.

Great docs. Powerful features. It just feels good to work with. My thoughts on framework A vs. framework B vs. no framework: They all "can" work and they all "can" fail. They all have their own set of pros/cons. Whatever you go with, commit to it and don't try and fight it too much :)

*Highly recommended podcast I've been listening to lately: Javascript Jabber (more Angular content, but plenty of Ember content/speakers lately)

nolros's avatar

@lossendae, you are correct in that you can configure blade to run with Angular. Example, setting Blade::setContentTags('[[', ']]');Blade::setEscapedContentTags('[[[', ']]]'); to remove tag conflict, but because of the way Angular works in that it compiles HTML you will run into problems. Same way you cannot just write JQuery to change DOM elements in Angular and why it requires "element" / Jlite for JQuery. I have a complex tooltip JQuery module that I tried to run natively in Angular. Porbabaly my crappy Jquery code, but Angular was not happy even when I ported everything to element.

You would have to configure $watch, interceptors, etc. to ensure that it does not blow up. You cannot just change a DOM element without telling Angular how to deal with that change or when to $compile. That said, you I assume you can if you are only using Angular inline HTML directives like "ng-", but if you have deep Angular JS code you will have it blow up on you. I can think of many examples of issues I've run into. Using ngMessage with Laravel validation, Angular caching, SessionManagement, ngRoute $routeProvider with Laravel routing when using redirects in Laravel. Fundamentally, Angular assumes a "single page" architecture for "compiling" purposes whereas Laravel is PHP and assumes a multi page interpretative approach.

If anyone has found a way to make these two work together seamlessly, please let me know as I'm spending a ton of time trying to make the two work together without crippling withers features.

lossendae's avatar

@nolros, I did try the two approaches (setContentTags or @ before an ignored blade tag) the second one worked better in my case.

In a template I use both :

<!--- Parsed by blade -->
{{ $username }}

<!-- Ignored by blade -->
@{{ username }}

It is rendered like the following :

<!-- Parsed by blade -->
lossendae

<!-- Ignored by blade -->
{{ username }}
codedungeon's avatar

+1 for AngularJS Being using ng for a couple years and have integrated with many many Laravel based projects.

nolros's avatar

Jeff, if you going to do a series it would be great build a Larabook with Angular and Laravel and tap into some of the best practices. Maybe team up with Egghead.io and build something you charge extra e.g. best practices for integrating L & A. I would pay extra for that series!

2 likes
Next

Please or to participate in this conversation.