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

Problem adding a custom component to ionic 4

$
0
0

@silvairsoares wrote:

I am using the command:

ionic generate component accordion-list

Then the following directory structure is created automatically:

components
-accordion-list
–accordion-list.html
–accordion-list.scss
–accordion-list.ts
components.module

So I’m trying to make a hello world with my custom component on any html page, like this:

It already includes and excludes entries for my custom component in the files: “app \ app.component.ts” and “app \ app.module.ts”.

However, I still get the following error on the console:

-------------------- Error --------------------
ERROR Error: Uncaught (in promise): Error:
Template parse errors:
‘accordion-list’ is not a known element:

  1. If ‘accordion-list’ is an Angular component, then verify that it is part of this module.

  2. If ‘accordion-list’ is a Web Component then add ‘CUSTOM_ELEMENTS_SCHEMA’ to the ‘@NgModule.schemas’ of this component to suppress this message. ("

[ERROR ->]
-------------------- Error --------------------

---------------- My Environment --------------------

Angular CLI: 7.3.2
Node: 8.11.2
OS: win32 x64
Angular: 5.2.10
… animations, common, compiler, compiler-cli, core, forms
… http, platform-browser, platform-browser-dynamic

Package Version

@angular-devkit/architect 0.13.2 (cli-only)
@angular-devkit/build-optimizer 0.0.35
@angular-devkit/cor 7.3.2 (cli-only)
@angular-devkit/schematics 7.3.2 (cli-only)
@schematics/angular 7.3.2 (cli-only)
@schematics/update 0.13.2 (cli-only)
rxjs 5.5.11
typescript 2.6.2
webpack 3.8.1

Ionic 4.10.3
---------------- My Environment --------------------

----------------- My questions --------------------

What are the correct locations for referencing my custom components?

Sorry for the outburst. But for what reason the command “ionic generate component …” does not make the necessary entries. Would not it be more intuitive?
----------------- My questions --------------------

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70904

Trending Articles



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