Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70443

Component in page not working in ionic 4

$
0
0

@krima wrote:

what i want to do is i have list with 3 items in new page and clicking of each appears respective component screen. I’ve
tried only one and it’s not showing not i’m able to click it also. What to do?

new.page.html

Profile {{p.title}}

new.page.ts

import { Component, OnInit } from ‘@angular/core’;
import { GroupComponent } from ‘src/app/component/group/group.component’;
import { Router } from ‘@angular/router’;
import { NavController } from ‘@ionic/angular’;

@Component({
selector: ‘app-new’,
templateUrl: ‘./new.page.html’,
styleUrls: [’./new.page.scss’],
})
export class NewPage implements OnInit {
// public ages = [
// { title: ‘Home’, Component: GroupComponent, icon: ‘home’ },

// ];
constructor(private router: Router,public navCtrl: NavController) { }

ngOnInit() {
}
openPage§ {

//this.router.na(p.Component);
//this.navCtrl.navigateForward('/Groomponent');

}
}

component.module.ts

import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from ‘@angular/core’;
import { CommonModule } from ‘@angular/common’;
import { SwitchControlComponent } from ‘./switch-control/switch-control.component’;
import { PanelControlComponent } from ‘./panel-control/panel-control.component’;
import { IonicModule } from ‘@ionic/angular’;
import { PipesModule } from ‘…/pipes/pipes.module’;
import { FanControlComponent } from ‘./fan-control/fan-control.component’;
import { FormsModule } from ‘@angular/forms’;
import { GroupComponent } from ‘./group/group.component’;
// import { DeviceComponent } from ‘./device/device.component’;

@NgModule({
declarations: [SwitchControlComponent,
PanelControlComponent,
FanControlComponent,

GroupComponent

],
imports: [
CommonModule,
IonicModule,
PipesModule,
FormsModule
],
exports: [
SwitchControlComponent,
PanelControlComponent,
FanControlComponent,
GroupComponent
],
schemas: [ CUSTOM_ELEMENTS_SCHEMA ]
})
export class ComponentModule { }

group.component.ts

import { Component, OnInit } from ‘@angular/core’;

@Component({
selector: ‘app-group’,
templateUrl: ‘./group.component.html’,
styleUrls: [’./group.component.scss’]
})
export class GroupComponent implements OnInit {

constructor() { }

ngOnInit() {
}

}

group.component.html



Title

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70443

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>