0

I've already done with the: https://www.techiediaries.com/custom-elements-shadow-dom/

For the last step, It work fine for me. but I want to know how to import it in angular project that is not importing script tag in index.html (e.g. from node_modules) ?

Thanks

1 Answer 1

0

You can import many external library in angular via npm install --save <nameOfLibrary>. This library will be place in the "node_modules" directory and will be known throw your package.json. This is for all the EXTERNAL libraries. When you'll upload your code on git, you won't upload the node_modules, because those externals libraries are public, there is no need to upload.

Now when you are creating a component in your angular project, you got two ways to call it.

  1. First, like you said, with the HTML tag <app-contact-form></app-contact-form> (the name og the tag come from :

    @Component({ selector: 'app-contact-form', templateUrl: './contact-form.component.html', styleUrls: ['./contact-form.component.css'] })

    1. with a routing in the module: many website explain it. One exemple : https://www.codingame.com/playgrounds/8104/angular-router-tutorial
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.