Posts

Showing posts from January, 2021

Connecting Angular to a Spring API

Image
     Not long ago I wanted to learn Spring, so I built a simple API that managed data for a conference. Now I've been learning Angular and I wanted to build something that I could use as a front-end for that Spring API. I followed along with these fantastic videos, and ultimately ended up with something that looked identical to what she built, but I wanted to try and get the Sprint API I built connected to my front end. The Spring API can display Sessions for a conference, stored in a local Postgres database, and I wanted to make a front-end application to display that data. I was pressed for time, and only ended up showing the sessions available, but I'm excited that I now have these tools available so I can continue to practice both Angular and Spring.     Getting the Angular site up was easy, and I borrowed some of the styling I found in the videos I watched. Once had a running site, showing off a fancy empty table, I was ready to show off some data...

Stepping into Angular

Image
     Angular is a web framework that uses TypeScript, it's very common on a lot of job postings so I wanted to at least get the basics down. It uses components, which I was a big fan of in React, and I like the class-template format of a component. Later I will build my own project from scratch, and see if I can't get it to connect to the API I build in Spring last week, but for now I've been following along with Deborah Kurata's great videos on Angular and wanted to show off some of the basics she's covered so far.     I like the file structure of Angular programs, it's easy to follow and I immediately felt like I knew where files would be. In this example application we built a page that displays a list of projects and we kept home page things in the home folder, product things in the products folder and shared things in the shared folder. I might have take the additional step to store product details things in a product details folder, but it wasn't too...

My First Spring API

Image
      If you read my last post, you'll know I had all sorts of troubles getting my Spring API connected to my Postgres server, but that was by far the most arduous part of my journey with Spring. The application only has simple CRUD commands right now, but that will be more than enough for me to later use this API when I start learning Angular.      Anyway, it's easy to get started with the Spring Initializer at start.spring.io . It's a simple form that lets you put in some basic information and then download a zipped file with your new project. From there, I just added a Models, Controllers and Repositories folder (and did all that stuff to get connected to my database, but you can check that out here ). Once I had created files for the different speakers and conference sessions (the data is all from a PluralSight conference or something), my file structure looked like this:      The biggest takeaways I had were on setting up ...