I seem to be encountering a recurring error that I can't seem to resolve, despite trying various solutions. Below is the content of my appModule.ts file:
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { BrowserModule } from '@angular/platform-browser';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
CommonModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
It appears that I have included all necessary components, but please let me know if anything is missing. Additionally, here is the template from my app.component.html file:
<div class="container">
<span class="text-center">
<h1>{{Portfolio.firstName+' '+Portfolio.middleName+' '+Portfolio.lastName[0]}}</h1>
<h2 class="subHeading">{{Portfolio.subheading}}</h2>
<img src="../assets/img/me.JPG" class="rounded-circle mx-auto d-block smallerImg">
</span>
<div class="row justify-content-center">
<a [href]="social.link" class="p-2" target="blank"
*ngFor="let social from Portfolio.socialMedia">
<i [style.color]="social.color" [class]="social.icon"></i>
</a>
</div>
</div>
Furthermore, here is the content of my app.component.ts file:
import { Component} from '@angular/core';
import { CommonModule} from '@angular/common';
import { OnInit, NgModule } from '@angular/core';
import { Portfolio } from './../models/portfolio.interface';
socialMedia: [
{
icon: 'fa fa-linkedin fa-2x',
link: 'https://www.linkedin.com/in/akshay-kumar-603740136/',
color: '#007bb6'
},
{
icon: 'fab fa-github',
link: 'https://github.com/akkie00',
color: '#6e5494'
}
],
In this code snippet, you can see the array that I am attempting to iterate through. However, I am encountering the following error message:
compiler.js:486 Uncaught Error: Template parse errors:
Can't bind to 'ngForFrom' since it isn't a known property of 'a'. ("v class="row justify-content-center">
<a [href]="social.link" class="p-2" target="blank"
[ERROR ->]*ngFor="let social from Portfolio.socialMedia">
<i [style.color]="social.color" [class]="soc"): ng:///AppModule/AppComponent.html@8:5
Property binding ngForFrom not used by any directive on an embedded template. Make sure that the property name is spelled correctly and all directives are listed in the "@NgModule.declarations". ("
</span>
I would greatly appreciate any assistance or insights into resolving this error. Thank you.