After stumbling upon a beautiful HTML template that caught my eye, I realized it was built using Bootstrap. Luckily, I came across tutorials on how to convert such templates into Angular 6 projects, making the process seem quite straightforward (like this one).
I started by adding the first component, and the head section looked something like this (I've commented out most of the link tags to work with them one at a time):
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Some Html Template</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="" />
<meta name="keywords" content="" />
<link rel="stylesheet" type="text/css" href="../../assets/css/animate.css">
<!-- <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/line-awesome.css">
<link rel="stylesheet" type="text/css" href="css/line-awesome-font-awesome.min.css">
<link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/jquery.mCustomScrollbar.min.css">
<link rel="stylesheet" type="text/css" href="lib/slick/slick.css">
<link rel="stylesheet" type="text/css" href="lib/slick/slick-theme.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/responsive.css"> -->
</head>
Subsequently, I made updates in angular.json:
"styles": [
"src/styles.css",
"src/assets/css/animate.css"
],
"scripts": [
"node_modules/bootstrap/dist/css/bootstrap.min.css"
]
In styles.css, I imported:
@import "../node_modules/bootstrap/dist/css/bootstrap.min.css";
Additionally, I installed:
npm i bootstrap ngx-bootstrap jquery tether
However, when attempting to run npm start
, an error message pops up:
ERROR in HostResourceLoader: loader(/Users/felipe/Documents/mtalents/frontend/src/assets/css/animate.css) returned a Promise
Running without the link tags works fine, but the styling is absent (rendering just text). Surprisingly, the script tags remain unaffected.
Just to clarify, I transferred css, fonts, images, js, libs, vendor folders from the Bootstrap template into src/assets.
Any idea what I might be overlooking? Appreciate your assistance!