What's the point of combining Angular with Meteor?


#1

I was reading the latest blog post on Meteor.com about combining Angular with Meteor. What’s the point? Doesn’t Meteor already handle templating and data-binding? What functionality does this actually add?


#2

Meteor 's data binding only goes half way, it doesn’t provide 2 way data binding or a way to declare event handling.


#3

I just started with Meteor and Angular (combined) primarily for the 3-way data binding: http://angular-meteor.com/tutorial/step_03.


#4

Ok, so if we use your viewmodel package, is there any other reason left to prefer angular?


#5

Here is my personal reason to prefer Angular (to Blaze): I know a bit of Angular and nothing of Blaze, and I just started with Meteor.

I don’t think the point is to prefer one library over another. The Manifesto is openly neutral in stating:

Neutrality
We are here to give neutral perspective on the two frameworks.
From: http://angular-meteor.com/manifest


#6

Yep, I get that, so let me rephrase; if one feels equally comfortable with blaze and angular, and that blaze gets mvvm with manuel’s package, what would the pro’s and con’s be with going with either one? also, let’s keep react out of this discussion, please :slight_smile:


#7

I’ve used both in large applications. And the reason I prefer Angular it’s because it gives you better ways to structure your application and control your dependencies.


#8

I think a good summary of reasons is on http://angular-meteor.com/manifest. Also this project is very important for people who use Angular and don’t use Meteor yet. Adding Meteor as a backend vs. something like Express is a big win for modern web applications I think. I did exactly that in my last project and if the current version of angular-meteor would have already existed it would have been even easier to move to Meteor as backend.

I wouldn’t recommend to use AngularJS when you are quiet new to Meteor and have never worked with AngularJS. AngularJS on its own has quiet a learning curve. You can many of the benefits of AngularJS with a more lightweight solution like space:base.


#9

Not that I can tell, but then again I’m biased.

Angular embraces the concept of view models (controllers) but it was made by Java people and it shows (it’s full of ceremonies and chrome).


#10

Thanks everyone for your replies.

So as I get it, the gist of it is:

  • if you are familiar with meteor and don’t know angular, don’t beat yourself about it, you’re good
  • if you are familiar with neither, remember that angular has a steep learning curve with not too much more to offer
  • if you are familiar with angular, by all means reuse your experience to build on top of it with what meteor has to offer as a backend

#11

Angular2 will be a lot better in this regard, from what I can tell. I’m holding off on using angular with Meteor until angular2 is at least in or very close to beta with more complete docs available. But then I think it’ll rock. My reason? Meteor itself lacks useful abstractions in the “MVC layer”. It’s a little too low-level and not as well-structured (or as good-structure-imposing or -enabling as it could be and as that frontend layer should be).

ps. If anyone is already starting to use angular2 please message me. I’d love to work together, or at the very least just talk through some things!


#12

Angular 2 is a step in the right direction but it still suffers from needless ceremony. Check out this interview with a former angular 2 dev: http://herdingcode.com/herding-code-203-rob-eisenberg-on-aurelia/

And then check out the project Aurelia. It’s very close to what ViewModel is like.


#13

Vuejs does not have “ceremony” compared to Angular.
Check it out

meteor add vue:vue


#14

So what about your thoughts around vuejs vs viewmodel?


#15

Would love Aurelia with Meteor :smile:


#16

Ceremonies are all the needless things you do just to comply with a framework or compiler.

Here’s a view model with Vue:

Here’s the same with Angular:

Now compare those two with ViewModel:

@serkandurusoy ^


#17

there is none. Moving along…


#18

viewmodel has the advantage that was created for use with meteor.I like it for that.

But speaking of reduced code how do you filter a list using a search box ?
From the viewmodel docs i see some javascript to filter simple data

here the vue sample with no javascript coding to filter, just html

http://jsfiddle.net/rsbcLg07/1/

how do you achieve filter without coding javascript using viewmodel ?
Vuejs has some builtin filter capabilities
http://vuejs.org/api/filters.html
for more specific filters we can create one with javascript.

I can also combine filters like

li v-repeat="objectValues | filterBy searchText | first(10) |orderBy msg -1 " >{{$key}} : {{msg}}

i only have to code first() as it is a custom function

Also to remove items from the model i see more javascript code in viewmodel
in vue can be as simple as this


#19

I agree, is “ceremony” is avoiding putting database queries in the midle of template helpers, i like ceremony :wink:


#20

The thing is that you don’t have less code, you’re just embedding it into the markup. It’s like someone using React saying “I don’t have html templates” (yes you do, you just embed them into your JavaScript).

But let’s say there’s a feature you want that ViewModel doesn’t have (something that isn’t just a matter of moving the code from one place to another). There’s a huge difference between rolling up your sleeves and adding a feature to a framework, and having to perform ceremonies/chrome/boilerplate (whatever you want to call it) on a routine basis solely because the framework asks you to do so.

ViewModel is built from the ground up to try to minimize that as much as possible. It achieves it by “cheating” in the form of exploiting everything Meteor has to offer.