using AI to build software and how to avoid the race to the average
Using AI to build software can result in a slippery slope towards developing average code.
PLEASE ACCEPT OUR. COOKIE POLICY
This article is part of a series. If you want to catch up you can start here - it won't take long. Alternatively you can download the git repo from here
The App currently looks like this:
We are going to add Bootstrap 4. Then we will change the menu component to use Bootstrap CSS classes and Angular, and see how much better it looks.
Open your project in your IDE, or open a command prompt at the root of the project. Type the following :
npm install bootstrap
npm install jquery
Open the "angular.json" file. We need to add the Bootstrap styles file into the first line of the styles array. Currently the styles array in "angular.json" will look something like this:
"styles": [
"src/styles.scss"
],
We are using the "SCSS" format so we change it to the following:
"styles": [
"node_modules/bootstrap/scss/bootstrap.scss",
"src/styles.scss"
],
If you are using the "CSS" format change it to the following:
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.css",
"src/styles.scss"
],
Because we have changed "angular.json, we need to run "ng serve" again. The App should now look like this if Bootstrap is integrated correctly:
Adding Bootstrap has changed the look of the App slightly, but we need a menu that actually uses Bootstrap CSS classes in order to really see what Bootstrap can do. Our new menu is going to use Angular as well as Bootstrap so we will need to make changes in all three of the "navmenu.component" files.
We need to add one property and one method to the "navmenu.component.ts" file. Add the following above the constructor:
navbarOpen = false;
toggleNavbar() {
this.navbarOpen = !this.navbarOpen;
}
Now paste the following into "navmenu.component.html" to completely replace the existing contents:
Although we love Bootstrap we are always going to want to make a few customisations to get our own look and feel going in our App. We can do this by putting some CSS code into the "navmenu.component.scss" file:
.container{
margin-bottom:15px;
}
.bg-primary {
background-color: #030A8C !important;
}
.menu-background {
background-color: #030A8C;
}
We've now added Bootstrap to our basic Angular 9 App. We also changed the menu component to use Bootstrap and a bit of Angular. TheApp should now look like this:
If you got lost you can access the git repository here
Now we are going to use Angular CLI to add a service and connect components to it.
Using AI to build software can result in a slippery slope towards developing average code.
Using DotNet 8 and Aspire With Azure Container Apps Makes Kubernetes Enabled Apps Incredibly Easy
Moving to a micro-services architecture can sometimes seem daunting due to the amount of technical choices to be made and the amount of planning involved. Often however, the migration can be made in manage-able steps. Here is one classic example.
Fast Endpoints have become very popular with .Net developers recently, but how much faster are they than regular Controller endpoints using .Net 8
GPT4 and other tools have good text summarisation capabilities but only Deep Mind is providing the real breakthroughs.
Managing Infrastructure State can be tricky in the cloud. AZTFY and Terraform can help with management