New Project..Blaze or Angular 2. Deliver in 2 months

I like Angular 2 design, but am concerned it is not stable enough and I cannot easily or efficiently use a lot of pre-built pieces out there. Any thoughts.

Thanks!
Greg

Given the choice of the two and the limited time, I think I would ask first…

Which one are you skilled at? Blaze or Angular2?

Have worked only a little on each. Comfortable with Typescript and MVC/P.
So about the same really.

For two months, and if you’re familiar with both, I think Blaze would be better. Angular2 support is getting there, but there’s still a few issues that people (like me) raise. So it’s better you stick to a more stable target.

Angular 1.x on the other hand is pretty stable so far. But you’d lose the typescriptiness. At least you’d have a whole slew of angular modules at your disposal.

blaze all day all day all day

If you do not have past Angular experience, I believe Blaze is a lot faster to get everything you need done. It’s 90%+ just HTML so as long as you know HTML you can use Blaze, and the learning curve is very light (only a few commands you actually need to use, that are all similar usage to the very basics of programming), with the problems you have to learn to resolve being few and far between once you grasp the basics.

Basically if you learn how helpers work (make a few basic ones for help with comparison/whatever your project needs - for example an “equals” helper that checks if 2 arguments are equivalent - it helps make functionality similar to a “switch” statement, another helper to reformat dates or price values to $x.xx format, etc), how to use loops, #with, and #if, you pretty much know everything you will likely need to know.

Oh, and for DOM manipulation (JQuery, etc) put the code you’d normally throw in document.ready in to the onRendered function.

Complete that, and congratulations, you know Blaze =)

(Edit: For an example of that “equals” helper I mentioned, add this in to a client js file:

Template.registerHelper("equals", function (a, b) {
    return (a == b);
});

Now you can use it any time in any template as:

{{#if equals myBoolean true}} 
    <p>success!</p>
{{/if}}  

if you need functionality similar to a switch statement in a Blaze template, you can use multiple of these!)

If you stay at Blaze, use ViewModel.

Why?

  • Component/Template communication
  • Clear state for each component
  • 2-way binding
  • Better object structure
  • Use every defined function as template helper
  • Validations
  • …
1 Like

ViewModel is indeed awesome.

But if you are on a short deadline, lower learning curve might be a priority. Try ViewModel out and decide for yourself!

In addition, reloads seem faster on Blaze. But I have no scientific proof of that. My hypothesis is that there’s less it has to reload (because even if you have Angular, Blaze still gets loaded)