'image-cropper' is not a known element error
See original GitHub issueHi,
at first thanks for this nice project! I wanted to create a component which allows me to upload and crop it afterwards.
I have a module for the ui components: ui.module.ts
import { NgModule } from '@angular/core';
import { ImageCropperModule } from 'ngx-image-cropper';
import { ImageUploadComponent } from './image-upload/image-upload.component';
@NgModule({
imports: [
ImageCropperModule
],
declarations: [
ImageUploadComponent,
],
exports: [
ImageUploadComponent,
]
})
export class UiModule { }
image-upload-component.html
<input type="file" (change)="fileChangeEvent($event)" />
<image-cropper format="png" (imageCropped)="imageCropped($event)" (imageLoaded)="imageLoaded()" (cropperReady)="cropperReady()" (loadImageFailed)="loadImageFailed()"></image-cropper>
<img [src]="croppedImage" />
Here I’m getting the error:
‘image-cropper’ is not a known element:
- If ‘image-cropper’ is an Angular component, then verify that it is part of this module.
- If ‘image-cropper’ is a Web Component then add ‘CUSTOM_ELEMENTS_SCHEMA’ to the ‘@NgModule.schemas’ of this component to suppress this message.
When I’m importing the ImageCropperModule in the app.module.ts directly and then using the image-cropper component in the app.component.html then everything works well. What’s my fault with the extra module?
Thanks in advance!
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
'angular-cropper' is not a known element - Stack Overflow
html i get 'angular-cropper' is not a known element:' error. I have tried anything know, any help is highly appreciated. ionic3.
Read more >ngx-image-cropper - npm
An image cropper for Angular. Latest version: 6.3.2, last published: 9 days ago. Start using ngx-image-cropper in your project by running ...
Read more >A-l-y-l-e/Alyle-UI - Gitter
Result: "ERROR Error: Uncaught (in promise): Error: Template parse errors: 'ly-icon' is not a known element:" when the app loads. @Enlcxx - this...
Read more >Image Cropper Angular Component - Alyle UI
Just crop image. Just crop the output image and it is not resized.
Read more >Angular Error NG8001: is not a known element ... - YouTube
https://readdy.net/Notes/Details/1827Angular Error NG8001: 'mat-progress-spinner' is not a known element :Angular Error is an Angular ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Ok, very strange. I restarted my vs code, recompiled the project and it works like expected 🙄
I have no idea to be honest. Importing the ImageCropperModule in the module where the component is used, should be enough. Like you did.