Day 56: Breaking it down…

After my little adventure last night where I almost permanently hosed my server, I decided to leave well enough alone for now and just go with the pages I’ve rendered so far. If we’re going to have to rewrite pages in Angular, I’d just as soon not have too much to convert. I do want to work on eventually converting them all, so that I can practice different types of server routing…Oh my God…I really AM turning into a nerd…

Today’s deeper dive into Angular was a bit better than yesterday, although I’m still not sure HOW we’re going to pull off rewriting our pages. I’ve been reading ahead and it STILL looks confusing. I’m hoping that as we go along it will become clearer. I get the concept of breaking things (the partials and views we have now) into components, but we’re launching into another round of divding things up further into routes, components, and providers (services). We did a few of these today and I STILL have no idea how to determine what goes into which type of file.

In other more exciting news, I believe I’ve figured out how to vary my nav bar using Handlebar conditions, depending on whether a user is logged in or not. My next step is to figure out how to pull this off for users who are admins, so that other users (a.k.a. the unwashed public) aren’t privy to the admin link.

Actually, after last night’s adventure, my next step is to go to bed!

Day 50: Getting My Kicks…

…not exactly on Route 66…

As I mentioned last time, I did get our two assigned labs done. HOWEVER, I’m evidently insane, because I went nuts today and decided to try to convert my entire capstone project into our newly-learned Node Express hbs page format with routes and partials. I did manage to get all my pages to render, but as far as functionality…this was sort of hit-or-miss. The simple files were easy to create routes for. However, one of our databases has team info and then member info under each team, which is proving tricky to try to create routes for. I tried to check our original capstone server code to see if I could try to figure out how to crack the code (so to speak). At about 6:00 p.m. I finally created one “team-by-league” route which now makes my team page fully functional! I’m hoping to be able to figure out the other team/member routes.

The other issue is that my original capstone code relied heavily on URLParams. Now that we’re using routes I need to figure out a way to pass data to the member pages (add/delete/edit). I tried session storage, which I’d hoped would be the magic bullet, and indeed it was—for team data. For the member data underneath the team it was a fiasco. The code loops through all the members of a team and then stores the data for the LAST member in session storage. When you click an icon to go to a member’s edit or member delete pages, you land on the LAST person’s pages, no matter who you pick. I need to figure out how to pass the team ID and member ID to grab member data using yet another route (which you know is going to be convoluted).

Well, tomorrow is another day!

Chuck Berry – Get Your Kicks on Route 66