Jonathon Harrelson

Web Developer & Search Engine Optimization Specialist

Angular 2, is it Good for Web Development?

Angular 2, is it Good for Web Development?

With Angular 2 being released in October of 2016 (that’s about 3 months ago from the time of this blog post) , and I’ve seen talks of Angular 4 already being release in March 2017 (that’s about 3 months from the time this blog post was written) that’s only 6 months between major releases. Which tells me that there could be a lot of fluctuations in the library. From my experience learning Angular 2 since the summer of 2016, there has been a ton of changes from beta to release candidate to initial release to the current  version (currently 2.4.0). Many thing like routing and general best practices have changed drastically since the original release just 90 days ago.

Should I Use Angular 2 To Build Websites?

Short Answer, No.

Here’s a more detailed explanation to help you decide whether or not it is the right choice for you. From my experience, if you are displaying static content, or content in an api that uses a specific formatting of JSON:

blog.json
"blog": {
{
"blog-title": "sample 1"
},
{
"blog-title": "sample 2"
},
{
"blog-title": "sample 3"
},
{
"blog-title": "sample 4"
}
}

Notice how each “post” does not have a string key attached to it. This is the ideal use-case for Angular 2 and you can create a site pulling data from a RESTful API service if the JSON is formatted in this manner. I wanted to use Firebase, because it can be my storage, database, and authentication service all in one. The problem with this is the JSON that Firebase generates looks like this:

"blog": {
"-K_aMEEh0CS9S1DowJcg": {
"title": "sample 1"
},
"-K_aMF--eV4VVcyQI-Ai": {
"title": "sample 2"
},
"-K_aMFkaTg7ZF9Hn_Sk9": {
"title": "sample 3"
},
"-K_aMGyB6PC_PL8R7Dww": {
"title": "sample 4"
}
}

This is not ideal because you can’t simply loop through the array, you have to go into each object and loop through it’s array. I was unable to figure out how to do that. You can how ever use their JavaScript SDK (software development kit) and make it work as I was able to do. I did not go this route because I was using Angular Universal more specifically the Angular Universal CLI. The javascript for the SDK does not play well with the pre render servers for Angular Universal so this was not a viable option for me.

With regards to SEO, Angular 2 is not a good option to build websites as of now. That being said, Google owns Angular 2, so I’m sure the good folks over there will eventually make it play nice search engines.

Is Angular 2 Good For Applications?

YES! Angular 2 works really well if showing up in search results is not an issue. The SDK is amazing and powerful and makes things like authentication, reading, writing, and storing data. As stated previously, the volatility of Angular and the rate at which major releases are scheduled to come out (every 6 months) still could mean tons of headaches but that the growing pains you have when dealing with a new framework.

Where can I store and retrieve my data from?

There are many avenues to approach this. You can use MongoDB for your own self hosted solution, or you can use a service like Firebase. I prefer firebase, as it is owned by Google. I have not heard of any security issues with it, unless you don’t set up the permissions on your database properly. It can handle authentication, storage, and your database needs. Firebase has a robust SDK that is very well documented and easy to use and understand. It works well if you’re developing a mobile application too, you can share data between your web app and mobile app seamlessly. With firebase you also can take advantage of it’s RESTful API to access your data OR make your data accessible as a RESTful API service. Firebase was a no brainer to me and the best part… it’s free up until you use over 1GB of Database and/or 5GB of storage. There’s other caps too you can check them out on the Firebase Pricing Page

Leave A Comment