Why Vue 2 beats Angular 2 and React – Jon Paul Miles – Medium

  • At first it was going to be Angular 2 vs React, but then a friend mentioned that people who used Vue wished they had known about it sooner and preferred it over React.I built a small dynamic single page in a single app in Vue 2, Angular, and React and I measured things like learning time, difficulty, and boilerplate.
  • The boiler plate was less than Angular 2 and less than React.
  • Vue also had directives which allowed my users to maintain their theme api.Vue is more like Angular 1 than Angular 2 is (without Dependency Injection) and it’s faster than even React.Vue 2 combines the best parts of React, and Angular 1 2.
  • Keep in mind when I said Angular 2 took I week, I meant just the initial learning not mastery.ConclusionFor any new web app, I will almost certainly recommend Vue 2 over React or Angular 2.
  • Members of your team can learn and master it faster, the framework runs faster than the other two, the boiler plate is the least exhausting, and it provides the best capabilities of React and Angular 1 2.

We started a contest at my job to see which framework was the best. At first it was going to be Angular 2 vs React, but then a friend mentioned that people who used Vue wished they had known about it…
Continue reading “Why Vue 2 beats Angular 2 and React – Jon Paul Miles – Medium”

Journal: How to embed Vue.js & Vuex inside an AngularJS app… wait what?

  • With Vuex, a new possibility presented itself—what if I built time-tracking as a Vue app within Cushion?
  • Vue’s view model instance is incredibly lightweight and performant, so when a user switches to the time-tracking tab, Cushion can mount the instance and make any requests to the API from Vuex.
  • Now, I can reference the Vue app’s state across the rest of Cushion and inject it into any Vue instance by simply specifying the store.
  • On top of that, this opens up a way for me to migrate Cushion from Angular to Vue in steps, rather than rewriting the entire app all at once.
  • I could rewrite the Angular controllers as Vue instances, and simply create new store modules in Vuex.

Since launching Cushion a couple years ago, we’ve been using AngularJS (1.x) as our front-end framework. If you’re curious how we ended up with Angular, I wrote about the decision (keep in mind this was 2014). I came from an MVCS background, so Angular really resonated with me, and it has served us well this entire time. Recently, however, with our improvements to the scheduling graph, we reached a point where performance has become an issue.
Continue reading “Journal: How to embed Vue.js & Vuex inside an AngularJS app… wait what?”

angular2

Delegate bindings from Angular 2 component to nested element  #angularjs #reactjs

  • I’ve been using Angular 1 for a couple years, but just started using Angular 2 this week.
  • I’ve read many articles such as Custom form controls in Angular, Angular docs, other somewhat-similar Stack Overflow questions, and the TypeScript used on Angular 2’s Material Checkbox but I still don’t get how they pulled this off.
  • This is one of many custom UI elements I need to make, so I’m hoping this example will help me understand the principles and implementation I’m missing.
  • I know I could use a input checkbox with a selector on it, and wrap it, but I want to be as clean as the Angular 2 Material checkbox is.
  • I’m essentially doing the same thing they are (Angular 2 Material), but with our own styling, and much more simplistic than all the options they provide.

I’ve been using Angular 1 for a couple years, but just started using Angular 2 this week. I’ve read many articles such as Custom form controls in Angular, Angular docs, other somewhat-similar Stack Overflow questions, and the TypeScript used on Angular 2’s Material Checkbox but I still don’t get how they pulled this off. It’s seems like it should be more straight forward.
Continue reading “angular2”

Why Vue 2 beats Angular 2 and React – Jon Paul Miles – Medium

  • At first it was going to be Angular 2 vs React, but then a friend mentioned that people who used Vue wished they had known about it sooner and preferred it over React.I built a small dynamic single page in a single app in Vue 2, Angular, and React and I measured things like learning time, difficulty, and boilerplate.
  • The boiler plate was less than Angular 2 and less than React.
  • Vue also had directives which allowed my users to maintain their theme api.Vue is more like Angular 1 than Angular 2 is (without Dependency Injection) and it’s faster than even React.Vue 2 combines the best parts of React, and Angular 1 2.
  • Keep in mind when I said Angular 2 took I week, I meant just the initial learning not mastery.ConclusionFor any new web app, I will almost certainly recommend Vue 2 over React or Angular 2.
  • Members of your team can learn and master it faster, the framework runs faster than the other two, the boiler plate is the least exhausting, and it provides the best capabilities of React and Angular 1 2.

We started a contest at my job to see which framework was the best. At first it was going to be Angular 2 vs React, but then a friend mentioned that people who used Vue wished they had known about it…
Continue reading “Why Vue 2 beats Angular 2 and React – Jon Paul Miles – Medium”

Why Vue 2 beats Angular 2 and React – Jon Paul Miles – Medium

  • At first it was going to be Angular 2 vs React, but then a friend mentioned that people who used Vue wished they had known about it sooner and preferred it over React.I built a small dynamic single page in a single app in Vue 2, Angular, and React and I measured things like learning time, difficulty, and boilerplate.
  • The boiler plate was less than Angular 2 and less than React.
  • Vue also had directives which allowed my users to maintain their theme api.Vue is more like Angular 1 than Angular 2 is (without Dependency Injection) and it’s faster than even React.Vue 2 combines the best parts of React, and Angular 1 2.
  • Keep in mind when I said Angular 2 took I week, I meant just the initial learning not mastery.ConclusionFor any new web app, I will almost certainly recommend Vue 2 over React or Angular 2.
  • Members of your team can learn and master it faster, the framework runs faster than the other two, the boiler plate is the least exhausting, and it provides the best capabilities of React and Angular 1 2.

We started a contest at my job to see which framework was the best. At first it was going to be Angular 2 vs React, but then a friend mentioned that people who used Vue wished they had known about it…
Continue reading “Why Vue 2 beats Angular 2 and React – Jon Paul Miles – Medium”

Writing AngularJS Apps Using ES6

  • The following snippet creates these WeakMaps and the class HomeController:
    const INIT = new WeakMap();
    const SERVICE = new WeakMap();
    const TIMEOUT = new WeakMap();

    class HomeController{
    constructor($timeout, bookShelfSvc){
    SERVICE.set(this, bookShelfSvc);
    TIMEOUT.set(this, $timeout);
    INIT.set(this, () = {
    = {
    this.books = books;
    });
    });

    INIT.get(this)();
    }

    markBookAsRead(bookId, isBookRead){
    return isBookRead)
    .

  • The this reference inside the arrow functions is same as the this reference outside, which is the current instance of the class
    The new syntax for creating a method and attaching it to an object without using the function keyword
    Let’s apply dependency injection and register this class as a = [‘$timeout’, ‘bookShelfSvc’];
    export default HomeController;

    As you see, there is no difference in the way that we applied dependency injection — it is same as the way we do in ES5.

  • The following snippet creates the factory class and registers the static method as a factory:
    var HTTP = new WeakMap();

    class BookShelfService
    {
    constructor($http)
    {
    HTTP.set(this, $http);
    }

    getActiveBooks(){
    return = result.data );
    }

    getArchivedBooks(){
    return = result.data );
    }

    markBookRead(bookId, isBookRead){
    return {bookId: bookId, read: isBookRead});
    }

    addToArchive(bookId){
    return }

    checkIfBookExists(title){
    return = result.data );
    }

    addBook(book){
    return book);
    }

    static bookShelfFactory($http){
    return new BookShelfService($http);
    = [])
    .

  • factory(‘bookShelfSvc’, default moduleName;

    This snippet uses the following additional features of ES6 (in addition to classes and arrow functions):
    A static member in the class
    String templates to concatenate the values of variables into strings
    Defining Directives
    Defining a directive is similar to defining a factory, with one exception — we have to make an instance of the directive available for later use inside the link function, because the link function is not called in the context of the directive object.

  • var Q = new WeakMap();
    const SERVICE = new WeakMap();

    class UniqueBookTitle
    {
    constructor($q, bookShelfSvc){
    this.require=’ngModel’; //Properties of DDO have to be attached to the instance through this reference
    this.restrict=’A’;

    Q.set(this, $q);
    SERVICE.set(this, bookShelfSvc);
    }

    link(scope, elem, attrs, ngModelController){
    = function(value){

    return reject) = {
    result = {
    if(result){
    reject();
    }
    else{
    resolve();

This article explains how ECMAScript 6 can be used to write AngularJS applications.
Continue reading “Writing AngularJS Apps Using ES6”

Journal: How to embed Vue.js & Vuex inside an AngularJS app… wait what?

  • With Vuex, a new possibility presented itself—what if I built time-tracking as a Vue app within Cushion?
  • Vue’s view model instance is incredibly lightweight and performant, so when a user switches to the time-tracking tab, Cushion can mount the instance and make any requests to the API from Vuex.
  • Now, I can reference the Vue app’s state across the rest of Cushion and inject it into any Vue instance by simply specifying the store.
  • On top of that, this opens up a way for me to migrate Cushion from Angular to Vue in steps, rather than rewriting the entire app all at once.
  • I could rewrite the Angular controllers as Vue instances, and simply create new store modules in Vuex.

Since launching Cushion a couple years ago, we’ve been using AngularJS (1.x) as our front-end framework. If you’re curious how we ended up with Angular, I wrote about the decision (keep in mind this was 2014). I came from an MVCS background, so Angular really resonated with me, and it has served us well this entire time. Recently, however, with our improvements to the scheduling graph, we reached a point where performance has become an issue.
Continue reading “Journal: How to embed Vue.js & Vuex inside an AngularJS app… wait what?”