0

I have added a condition and the page doesn't load the div anymore. Please let me know if I did something wrong. I am making an API call and fetching parentmodules which should bind if any data is present.

TypeScript:

import { Component } from '@angular/core';
import { Title } from '@angular/platform-browser';
import { ActivatedRoute, Router } from '@angular/router';
import * as _ from 'lodash';
import { Module } from '.../module';

@Component({
  selector: '...',
  templateUrl: './....html',
  styleUrls: ['./....component.scss']
})

export class AdministrationComponent {
  modules: Module[] = [];
  parentmodules: Module[] = [];
  showModules: boolean = false;..........
}

HTML:

<div *ngFor="let eachparentmodule of parentmodules" class="mt-5">
    <h6 class="mb-0 text-uppercase">
        {{eachparentmodule.name}}
    </h6>
</div>
karel
  • 5,489
  • 46
  • 45
  • 50
  • Does this answer your question? [Can't bind to 'ngForOf' since it isn't a known property of 'tr' (final release)](https://stackoverflow.com/questions/40331549/cant-bind-to-ngforof-since-it-isnt-a-known-property-of-tr-final-release) – Phani Rithvij Nov 06 '21 at 05:48
  • Check if BrowserModule is imported (https://angular.io/api/platform-browser/BrowserModule) – Nader Apr 03 '22 at 13:51

0 Answers0