Home > Enterprise >  To use a part of HTML code of one angular component in another
To use a part of HTML code of one angular component in another

Time:06-02

I have an angular component with code looks like

main component.html
<html>
   <div1>
     some elements
   </div1>
       <div2>
         some elements
       </div2>

I just want to use div1 in another component, is that possible

in child component I Should have

<html>
<div1>
  some elements
</div1> ////from main component 
<div2>
some elements
</div2>
<div3>

some elements

CodePudding user response:

You should import the component or the css file where you defined <div1> in the component where you need to use it

CodePudding user response:

You may refer to this Component Interaction

  • Related