Angular Reacts Only

Joseph Harwood
3 min readFeb 20, 2019

--

Angular and React are the top 2 front end development frameworks in the market currently. I, having just come off of learning my first Ruby framework, Ruby on Rails, thought it would be a good idea to familiarize myself with the most popular Javascript frameworks. Since React is already being covered by Flatiron School, I decided to check out Angular. I remember seeing Angular and React all over programming job posts, but I had no idea why you would choose one over the other. I decided to get to the bottom of this mystery in this blog post.

The first thing that stood out to me on the below graphic was that Facebook owns React and Google owns Angular. Both frameworks are open source. Another difference is that React uses Javascript and Angular uses Typescript. You also may have heard of AngularJS. Angular is a complete rewrite of AngularJS that uses Typescript. TypeScript informs about errors before the file is saved, thus, allowing, you to write code many times faster. Typescript is syntactically identical to Javascript, but was created by Microsoft to be more tailored towards the development of large-scale applications.

Source: https://appinventiv.com/blog/react-vs-angular

I followed this tutorial on Angular’s site to learn more about it:

One interesting thing about Angular is that it doesn’t have the concept of scope or controllers, instead it uses a hierarchy of components to do similar things. Components are the fundamental building blocks of Angular applications. They display data on the screen , listen for user input, perform actions based on user input. ReactJS has a similar approach.

This tutorial has component files for the application and heroes. There are only 3 types of files: CSS, HTML, and TS (Typescript). All of the components can be generated with `ng generate component heroes`. At the top of the heroes.component.ts, you import the “seed” data from mock-heroes.ts and import the Hero class from hero.ts.

The HTML and CSS files are similar to what you would see in Rails, other than the *ngfor and *ngif statements that have explanations in the photo below.

End result of getting through some of the Angular tutorial

Below are the benefits of using either React or Angular:

Source: https://appinventiv.com/blog/react-vs-angular

What I learned from this brief inquiry into Angular is that it is a viable alternative to React. The highest barrier to entry is that you need to know Typescript, and while the code is cleaner, debugging it can be quite difficult because of the lack of scoping. There is still a lot for me to learn about Angular and Javascript frameworks. I am looking forward to coming back to Angular after I learn React in a couple of weeks.

Sources:

https://angular.io/tutorial

https://indeema.com/blog/react-vs-angular--how-a-library-can-compete-with-a-framework

https://appinventiv.com/blog/react-vs-angular

https://gorrion.io/blog/angularjs-vs-angular

--

--

No responses yet