Ciao,
sto sviluppando un'app con cordova, angular e ionic:
Cordova: 9.0.0 (cordova-lib@9.0.1)
Angular: 7.2.15
ionic: 5.0.1
Vorrei includere una pagina html figlio all'interno di una pagina html padre attraverso ionic, ho provato ad includere un componente in questo modo:
Il componente che voglio includere contiene:
nel file mypage.page.ts ho messo:codice:import { Component, OnInit } from '@angular/core'; @Component({ selector: 'app-my', templateUrl: './my.component.html', styleUrls: ['./my.component.scss'], }) export class DerattizzazioneComponent{ constructor() { } }
e dentro mypage.page.html ho messocodice:import {MyComponent} from './mypath/my.component'; @NgModule({ declarations: [MyComponent] }) @Component({ selector: 'app-mypage', templateUrl: './mypage.page.html', styleUrls: ['./mypage.page.scss'], }) export class MypagePage implements OnInit {}
<app-my></app-my>
Quando vado ad eseguire il codice ricevo questo errore
Dove sta l'errore?codice:ERROR Error: Uncaught (in promise): Error: Template parse errors: 'app-my' is not a known element: 1. If 'app-my' is an Angular component, then verify that it is part of this module. 2. If 'app-my' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("........
Grazie.

Rispondi quotando