60

Angular is really useful for building single page applications. It is basically built on the current paradigm where we make requests to different endpoints to help us create better single page applications.

On the other hand, we have Meteor which seems even more capable, especially since they have a feature called DDP which basically allows bi-directional data streaming. It seems like Meteor is a superset of Angular and is the obvious better choice.

While Angular does offer some neat things like testing and localization, I just don't see why would I use Angular with Meteor as opposed to just using Meteor. Could someone explain why I would want to Angular with Meteor or even use any MV* front-end framework if I were to use Meteor?

Strawberry
  • 66,024
  • 56
  • 149
  • 197

6 Answers6

31

Most of our team's current apps are built with the combination of both frameworks.

I won't explain the reasons we use Meteor because that wasn't your question (although I love talking about how great Meteor is every chance I've got) so I'll just talk about Angular:

  1. Declarative approach - AngularJS is the leader in the declarative approach of Javascript frameworks. as we are working close with a lot of designers we can see how easy it is for them to understand to code. also getting new programmers into our team in much easier with AngularJS.
  2. Huge and great eco-system - Angular's eco system is amazing. you have angular-x for everything. it's a shame not to use that.
  3. It is now easier to combine them both - I'm obviously biased but our team wrote and maintain this library - angular-meteor and we've also released a tutorial for combining the two - angular-meteor tutorial

By the way - the current right answer is outdated. Meteor's new templating engine (Blaze) is out and it's great...

Urigo
  • 3,175
  • 21
  • 27
29

There are slight differences in the two. The most apparent to everyday work would be the binding.

In Meteor its a bit like having Angular but without this binding, since you have to manually do it. If you use angular it can bind to your html automatically, then Meteor can take this one step further and push it to the server and to everyone else.

Meteor does have testing too but its unofficial. You would have to install packages off atmosphere.meteor.com to use this extra functionality. There's lots of other stuff on there too.

One thing to keep in mind is Meteor has a new Templating engine in the works called Meteor-UI which addresses a lot of the concerns which the current implementation which angular has a leg up on. The main one would be DOM isolation. More details on it here: https://github.com/meteor/meteor/wiki/New-Template-Engine-Preview

The new Meteor-UI template engine actually goes a step further than angular since a new concept of 'controls' are introduced. This means you can add a textbox in with handlebars-esque like code and have it automatically bind to events and to the backend, with validation.

With localization there is a package on atmosphere that helps a bit with that. You can use handlebars placeholders and replace them depending on the language you intend to display.

It also depends on your preference, if you're comfortable with using Angular, it can create beautiful apps that feel very native. Meteor also does this in a different way, at the moment it does take a bit more work because of the binding but it would change in the next month or two because of Meteor-UI.

Tarang
  • 75,157
  • 39
  • 215
  • 276
  • I don't understand how is Angular's HTML binding needed, because doesn't Meteor automatically update the DOM as well? Could you elaborate more on this point? Perhaps I am misunderstanding what binding really means. – Strawberry Nov 08 '13 at 08:31
  • 12
    It does update the DOM. Binding means you have to bind your text box to the js and the placeholder to the reactive variable that stores the value. In Angular you just add in the `ng-xx` tag and it does that for you. In meteor you have to create an event for that text box to be bound, and for the helper's html placeholder holder to bind to the text box's content. Meteor swaps out the DOM for you but Angular both swaps the DOM out and binds up events depending on the tag's used. Meteor helps keep this reactive too, as does Angular. – Tarang Nov 08 '13 at 08:50
  • Great explanation! Now I understand the reasons for using Angular in front of Meteor. – Strawberry Nov 08 '13 at 18:46
  • 9
    does this article need an update? – krivar Sep 28 '14 at 08:43
  • We now have the best of both worlds, angular-meteor has arrived – Neil Aug 29 '15 at 19:09
6

We recently wrote an article on Meteor vs Angular. I think Angular can work as a compliment to Meteor right now, but Meteor will continue to move into the same front-end feature set as Angular everyday.

I would also say that I am a bit biased on the testing side of things, since I am writing the Testing Meteor book. There is a new initiative that has started called Velocity, which will standardize the testing scene for Meteor much more.

Anima-t3d
  • 3,431
  • 6
  • 38
  • 56
Josh Owens
  • 191
  • 2
  • 4
4

AngularJS is now officially supported from the v1.2 of Meteor and using them together is the most powerful solution I know on today. http://angular-meteor.com

As Meteor and AngularJS fields overlap on the view part, the real question is what are the benefits to use AngularJS as the tempting engine instead of Blaze ?

  • AngularJS generally requires less code to achieve the same result (easier and faster bindings, less glue code even if blaze is good at it)
  • AngularJS provides a convenient way to structure your code with modules which acts like local import or namespace. This is still "missing" even with the ECMA2015 support in the v1.2 but hopefully soon covered.
  • AngularJS 2.0 will / is faster than Blaze but for loading the lib
  • There is a lot of templates, libraries and other framework based on AngularJS, much more than Blaze.
Community
  • 1
  • 1
Flavien Volken
  • 19,196
  • 12
  • 100
  • 133
2

It all depends on you. If you are from angular background then it's easier to use it for your next project. Meteor is complete framework with command-line tool and inbuilt web server which can be used on both client and server for making real-time application. So you don't need to use angular if you are using Meteor. If your want to read more on Angular and Meteor, read FROM CLIENT-SIDE ANGULAR TO SERVER-SIDE METEOR

ep4f
  • 420
  • 1
  • 5
  • 14
-5

Angular is more widely used and is very popular due to its simplicity and completeness. It's simple because of its size and complete as it has all components including templating, data binding, etc.

While I really like and admire Meteor, I am unsure if it is ready for primetime. Lot of concepts in Meteor haven't been put to ringer in real production apps. For instance, having mongoDB lite on the client side can be a huge plus and can also be a big negative.

I'd pick Angular based on its readiness, simplicity and completeness. Meteor deserves a real evaluation when it is ready for primetime.