I can’t believe it’s been nearly three weeks since I completed the WDI course. In an effort to make sure I’m staying sharp with my coding skills, I’m going to try to complete coding challenges every week and create a new app every month. Will I succeed with living up to those goals? I sure hope so!
You can view the live app here and see the Github repo over here.
Today proved to be a day of frustration for my group – we’re struggling with Angular quite a bit. I managed to build up the back-end coupled with Angular as the front-end, however I’ve run into issues getting CRUD to function for the API. Update and show are working, it’s just a matter of getting delete and new to work.
After a day of struggling with my code, I’m on the verge of scraping everything and rebuilding. Sometimes you need to cut your losses.
I’ve reached the conclusion that Angular is hard. It will take some getting used to with running through several exercises before I feel comfortable enough with it.
Today we worked with Angular alongside Rails. It was cool seeing how we can create our own APIs when we need to be able to work with updating the API data. It was weird seeing how Rails as the back-end fits together with Angular as the front-end. We walked through putting together a couple of single-paged applications with the Rails/Angular combo, and I noticed that the Angular server acts a little wonky at times when working on updates.
In the afternoon we walked through working on a SPA with Firebase. Firebase is a Platform as a Service (PaaS), that offers a number of cloud-based computing services, including a realtime database. Firebase uses Websockets to maintain a constant, open connection between the client and the database. We used AngularFire, which is a way to connect an Angular application to a Firebase DB.
Application Program Interface (API) is a service that provides raw data for the public. We reviewed how we can create our own APIs so that we can use them for CRUD functionality in apps, which was a pretty fun scenario to take a look at.
In class, we played around with the following code to make API requests – and I thought it was a pretty good chunk of code that I could use for future reference when it comes to API-related projects:
var url = "https://api.wunderground.com/api/api_key/geolookup/conditions/q/va/midlothian.json"
// $.ajax takes an object as an argument with at least three key-value pairs...
// (1) The URL endpoint for the JSON object.
// (2) Type of HTTP request.
// (3) Datatype. Usually JSON.
console.log("Ajax request success!")
console.log("Ajax request fails!")
console.log("This always happens regardless of successful ajax request or not.")