Issue with Angular: Unable to bind to 'ngForFrom' as it is not recognized as a valid property of 'a'

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.

Answer №1

Attempt

*ngFor="let platform of Portfolio.socialMedia"

from is not the correct term. Please use of

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Error message: The property .match cannot be read as it is undefined (AWS Amplify Build Error)

I'm facing an issue when trying to deploy my React/Typescript app using Amazon's AWS Amplify. The build process keeps failing and the error message says: "Cannot read property .match of undefined". I've gone through numerous discussions, bu ...

Is there a method to globally import "typings" in Visual Code without having to make changes to every JS file?

Is there a method to streamline the process of inputting reference paths for typings in Visual Studio Code without requiring manual typing? Perhaps by utilizing a configuration file that directs to all typings within the project, eliminating the need to ...

Clicking on an element- how can I find the nearest element?

Encountering an issue with my next js app where I am attempting to assign a class to an element upon clicking a button. The problem arises when trying to access the next div using the following code snippet: console.log(e.target.closest('.request_quot ...

Is there a way for me to receive the status code response from my backend server?

My component makes a call to a servlet, which then sends a POST HTTP request to the backend (using Spring Boot). I want the backend to return the status of the POST request that was sent earlier. This is my code: res= this.CS.postcompetenze(this.comp) Th ...

AngularJS 2: Modifications to templates or components do not automatically reflect in the user interface

My background is in Angular 1, where everything worked seamlessly. However, I am encountering serious issues trying to create a basic application using Angular 2 in Visual Studio. After carefully following the "5 minute tutorial" and getting it to work, I ...

The element 'PROGRAM_ID' is not recognized within the 'import @metaplex-foundation/mpl-token-metadata' type

I am currently in the process of creating a token within the Solana network, but I've encountered a particular issue. I have successfully installed @metaplex-foundation/mpl-token-metadata and integrated it into my code; however, an error is persisting ...

Encountering an error in TypeScript and ng2 rc.1: Error message (20, 15) TS2304 indicates that the name 'module' cannot be found

Having trouble with TypeScript and ng2 rc.1 - getting Error:(20, 15) TS2304: Cannot find name 'module'. I encountered this issue when trying to use a directive of the module in my code: @Component({ selector: 'Notes1', moduleI ...

Angular tutorial on splitting a JSON array

I am looking to extract a portion of a JSON array in Angular. The array looks like the one in the image below.https://i.stack.imgur.com/w0hqC.png Below is the code snippet: export class AppComponent { color: string = 'green'; public stocklis ...

Embedding an Angular 2 component within another component

Developing a character creation tool for an RPG game. Within the NewCharacterComponent, I am attempting to integrate a DieInputComponent. The NewCharacterComponent is accessed from an AppComponent. Key excerpts of the code are provided below. The challen ...

Transforming Angular application into a microfrontend architecture

I've successfully developed an Angular application and now I'm looking to transform it into a microfrontend application using the single SPA approach. Can someone please advise me on the necessary steps to achieve this? Also, I'd appreciate ...

What could be causing input to be blocked in certain situations while using my Angular directive with compile function?

Recently, I created a directive that adds a class based on a certain condition. You can find the code snippet at the end of this question. The directive functions as expected in a simple use case where it's applied to a required field: <input typ ...

Every time I attempt to install a package, I encounter an NPM unmet peer dependency issue

Entering the complex world of NPM for the first time has been quite a challenge. After running create-react-app, the installation process is almost complete except for some warning messages: yarn add v1.17.3 [1/4] Resolving packages... warning react-scri ...

How can I dynamically replace a specific element inside a .map() function with a custom component when the state updates, without replacing all elements at once?

I'm currently developing a task management application and I need to enhance the user experience by implementing a feature that allows users to update specific tasks. When a user clicks on the update button for a particular task, it should replace tha ...

What is the best way to send an array to the @input() of a separate component in Angular?

Successfully passed my array to the first @Input() and displayed its contents. Now, facing a challenge where I need to pass data from the first @Input() to the second @Input() and display it. Still navigating my way through Angular and learning the ins a ...

Styles in print CSS are not effective in an Angular project

Currently, I am working on an Angular project where I need to generate a printable document using CSS. The challenge I am facing is ensuring that the date and title in the header do not print automatically when the document spans multiple pages. Additional ...

Utilizing Angular Pipes for Utilizing Location

The Location service in Angular is described as "A service that applications can use to interact with a browser's URL." One of its methods, getState(), provides "the current state of the location history," while another method, subscribe(), allows us ...

Obtain user information post-payment with Angular's latest Paypal Checkout 2.0 feature

My app is all set up to sell various items, with PayPal handling the payment process. In order to generate invoices, I need to access user details such as their name and address, which are stored by PayPal for each user. How can I retrieve this information ...

Is there a solution for resolving the Element Implicitness and Lack of Index Signature Error?

I encountered an issue with specialCodes[letter]. It mentions that The element implicitly has an 'any' type because the expression of type 'string' cannot be used to index type and No index signature with a parameter of type 'strin ...

Utilizing TypeScript in Kendo UI for JQuery

I have implemented KendoUI for JQuery using TypeScript. Here is an excerpt from my "package.json" file: "dependencies": { "@progress/kendo-theme-material": "^3.19.2", "@progress/kendo-ui": "^2020.3.915 ...

Angular ViewChild using a Directive as a selector results in a value of null

I have been working on a test component that includes an example of two directives, with one being used as an attribute directive. I am utilizing the ViewChild decorator to access these directives in the ngAfterViewInit handler. However, when I try to retr ...