I am new to angular right now angular 7 using.I want to create angular elements so importing import { createCustomElement } from '@angular/elements' but it giving error Cannot find module '@angular/elements'. Any help will helpful.
To solve the error "Cannot find module '@angular/core'", make sure you have installed all dependencies by running the npm install command, set the baseUrl option to src in your tsconfig. json file and restart your IDE and development server. Copied!
In order to use it in another Angular app, we don't really need to build the component; as it is a simple Angular component, we can just import and use it. But if we only have access to compiled files, we can include them with the scripts field in our angular.
A custom element hosts an Angular component, providing a bridge between the data and logic defined in the component and standard DOM APIs. Component properties and logic maps directly into HTML attributes and the browser's event system.
You have probably not installed @angular/elements
. Please install it.
Run
npm install @angular/elements
Another alternative
ng add @angular/elements --project=*your_project_name*
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With