Extend ng-boostrap popover component with custom angular directive

前端 未结 2 1333
终归单人心
终归单人心 2021-01-24 05:31

What i try to achieve is to extend ngbPopover directive and wrap in custom directive all this proeprties so instead of showing them just to include my directive.

For exa

2条回答
  •  旧巷少年郎
    2021-01-24 05:55

    Instead of creating a directive, you could also create a component with the selector my-popover.

    This component will hold your HTML template code:

    
    
        
    
    

    And then finally to use that, you could do the following:

    
    

    If you need to interact with that component, e.g. to listen to the click events have a look at input and output bidings of components.

    Hope this helps!

    For more information on the difference between components and directives, you could check this question.

提交回复
热议问题