@ssyedmo wrote:
Hi Guys,
I am trying to create a new custom component in ionic and trying to use it in the ionic page.
I have created a component like
import { Component } from ‘@angular/core’;
/**
- Generated class for the ImageuploadComponent component.
- See https://angular.io/api/core/Component for more info on Angular
- Components.
*/
@Component({
selector: ‘imageupload’,
templateUrl: ‘imageupload.html’
})
export class ImageuploadComponent {text: string;
constructor() {
console.log(‘Hello ImageuploadComponent Component’);
this.text = ‘Hello World’;
}}
I am importing the component in app.module.ts and setting the ImageuploadComponent in the declarations.
then I tried using the selector ‘imageupload’ in the ionic page as
This is breaking the page and showing me the error as
ncaught Error: Template parse errors:
‘imageupload’ is not a known element:
- If ‘imageupload’ is an Angular component, then verify that it is part of this module.
- To allow any element add ‘NO_ERRORS_SCHEMA’ to the ‘@NgModule.schemas’ of this component. ("[ERROR ->]"): ng:///TruckpictureuploadPageModule/TruckpictureuploadPage.html@0:0
at syntaxError (compiler.js:485)
at TemplateParser.parse (compiler.js:24668)
at JitCompiler._parseTemplate (compiler.js:34621)
at JitCompiler._compileTemplate (compiler.js:34596)
at compiler.js:34497
at Set.forEach ()
at JitCompiler._compileComponents (compiler.js:34497)
at compiler.js:34367
at Object.then (compiler.js:474)
at JitCompiler._compileModuleAndComponents (compiler.js:34366)I am stuck on this from long hours. Please help on this !!!
Posts: 1
Participants: 1