Angular was dead on arrival

Angular was dead on arrival

I'm commonly asked why more people don't choose "angular2" which in my head I correct to "angular". (we're on angular 3 alread.. no, 4,... no.) Quite simply, the answer is Typescript. Whether we like it or not the majority of javascript developers in our field are new or mediocre developers who don't have the time or cognitive ease to attempt to learn another language.

It was a huge mistake for the team to release the library with the small amount of constantly outdated documentation entirely in Typescript. Most stackoverflow searches for angular aren't even relevant or accurate given the constantly changing api. Without good documentation, and so much irrelevant or outdated answers on stackoverflow these developers lose hope, and angular lost potential users.

Originally I thought the quick rise of react was because they're backed by Facebook or they solved something new, but that's not entirely accurate. With vuejs we see a lot of similarities to react and angular. But what made it popular and with more users than angular so quickly wasn't solving something new, but something I think react did well: good documentation.

At any rate, I'll leave with some code done in the latest angular entirely in vanilla javascript, something that should have been available in the beginning.

import template from './assignUser.pug';  
import {Component} from '@angular/core';  
import {AccountAdmin} from './AccountAdmin';  
import {ActivatedRoute,Router} from '@angular/router';  
import {Breadcrumbs} from '../../services/Breadcrumbs';

@Component({
  selector: 'account-admin',
  template: template()
})
export class AssignUser{  
  static get parameters(){
    return [
      [AccountAdmin],[ActivatedRoute],[Breadcrumbs],[Router]
    ];
  }
  constructor(AccountAdmin,ActivatedRoute,Breadcrumbs,Router){
    this.AccountAdmin = AccountAdmin; //link service to page component
    this.Router = Router; //link service to page component
    this.ActivatedRoute = ActivatedRoute; //link service to page component
    this.navBarOpen = true;
    Breadcrumbs.clear();
    ActivatedRoute.params.subscribe(params=>{
      this.id = +params.id; // (+) converts string 'id' to a number
      Breadcrumbs.add('Account Admin','/#/accountAdmin');
      Breadcrumbs.add('Show Account',`/#/accountAdmin/${this.id}/show`);
      Breadcrumbs.add('Assign User');
      this.getUsers();
    });
  }
  getUsers(){
    this.AccountAdmin.getUsers(this.id).subscribe(res=> this.list = res);
  }
  saveAssignUser(){
    this.AccountAdmin
      .assignUser(this.id,this.list.user.value)
      .subscribe(res=> this.closeAssignUser(void res));
  }
  closeAssignUser(){
    this.Router.navigate(['../show'],{relativeTo: this.ActivatedRoute});
  }
}

About Nathaniel Inman

I'm a gamer, graphic designer, musician and software engineer. C++ and Javascript are my favorite two programming languages for which I develop exclusively in vim, tmux and zsh on Arch Linux.

Kansas City, Missouri http://www.theoestudio.com