"ionic ngfor in component" Code Answer's

You're definitely familiar with the best coding language Javascript that developers use to develop their projects and they get all their queries like "ionic ngfor in component" answered properly. Developers are finding an appropriate answer about ionic ngfor in component related to the Javascript coding language. By visiting this online portal developers get answers concerning Javascript codes question like ionic ngfor in component. Enter your desired code related query in the search bar and get every piece of information about Javascript code related question on ionic ngfor in component. 

ionic ngfor in component

By Cute CaterpillarCute Caterpillar on Oct 14, 2020

I'm going crazy, i've created a new component and he's working fine. Now i would like to use this on two pages.

Then i've created a component module (/components/all-components.module.ts) like this :

import { NgModule } from '@angular/core';
import { TagsComponent } from './tags/tags.component';
import { IonicModule } from '@ionic/angular';


@NgModule({
  imports: [IonicModule],
  declarations: [
    TagsComponent
  ],
  exports: [
    TagsComponent
  ]
})

export class AllComponentsModule {}

I've added on app.module.ts the AllComponentsModule and on my 2 pages module i have added same.

Now, my component work fine when i'm displaying text or variable, my console.log return the data, but if i use *ngFor nothing appear.

Finally, here's my component

import { Component, OnInit, Input } from '@angular/core';

@Component({
  selector: 'app-tags',
  templateUrl: './tags.component.html',
  styleUrls: ['./tags.component.scss'],
})
export class TagsComponent implements OnInit {

  @Input() userTags: any;

  constructor() {
  }

  ngOnInit() {
      console.log(this.userTags);
  }
}

And the view:

<p>hi</p>
<div *ngFor="let tag of userTags">
  <p>{{tag?.name}}</p>
</div>

Ok i don't understand why but if i use a module to store all of components. On my all-components.module.ts i have to put the CommonModule to interpret *ngFor, *ngIf, etc.

With CommonModule import all working fine !

Here's the code updated:

import { NgModule } from '@angular/core';
import { TagsComponent } from './tags/tags.component';
import { CommonModule } from "@angular/common";

@NgModule({
  imports: [CommonModule],
  declarations: [
    TagsComponent
  ],
  exports: [
    TagsComponent
  ]
})

export class AllComponentsModule {}

Add Comment

1

All those coders who are working on the Javascript based application and are stuck on ionic ngfor in component can get a collection of related answers to their query. Programmers need to enter their query on ionic ngfor in component related to Javascript code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about ionic ngfor in component for the programmers working on Javascript code while coding their module. Coders are also allowed to rectify already present answers of ionic ngfor in component while working on the Javascript language code. Developers can add up suggestions if they deem fit any other answer relating to "ionic ngfor in component". Visit this developer's friendly online web community, CodeProZone, and get your queries like ionic ngfor in component resolved professionally and stay updated to the latest Javascript updates. 

Javascript answers related to "ionic ngfor in component"

View All Javascript queries

Javascript queries related to "ionic ngfor in component"

ionic ngfor in component pass data from child component to parent component react native angular filter ngfor angular get first element ngfor ionic cordova icon notification ionic lifecycle ionic modal navbar not showing ionic not compiling with proxy ionic status bar color this.productArray.filter()in ionic TypeError: Cannot read property 'name' of undefined ionic Ionic alert angular generate component angular generate component without spec angular get name of component create react component class How to add multiple classes to a ReactJS Component how to align text inside react component how to convert react component to image how to create a component in react native how to create component in reactjs how to link to a different component in reactjs without react router how to work react router another component pass props from parent to child react functional component pass text to button component react passing multiple props to child component in react placeholder component image react props is send undefind to functional component in react js react enzyme simulate click sub component react extend react.component react function component react functional component react make component full screen react warning can't perform a react state update on an unmounted component react-data-table-component react-data-table-component api action button react.component use ref call parent component to child react use ref in component reactjs visual studio code create react component shortcut VUE DECLARE COMPONENT IN MAIN.JS vue get component hash vue js lazy load component angualr add class to component How to acces props of a functional component component did mount in hooks Can't perform a React state update on an unmounted component ng generate component React Class Component ng generate new component ng g component angular navigate using component angular reload component angular show element in component How to Reload a Component in Angular typescript react switch case component warning can't perform a react state update on an unmounted component

Browse Other Code Languages

CodeProZone