Search code examples
angularabp-framework

How to show 'Linked accounts' modal of ABP commercial


I use ABP commercial framework, but in front side I use my own template and menu, so I want to put its linked account menu in my menu. The problem here is that when I click on 'Linked accounts' menu, it shows a modal and does not route to another address. If it was routing, I could use its route but I must show that modal, but I could not see anything in angular code about that menu. So how can I show that 'Linked accouts' modal in my custom template? enter image description here

enter image description here


Solution

  • I asked it from ABP Commercial's support and they answered as shown in below link:

    https://support.abp.io/QA/Questions/3553/How-to-show-%27Linked-accounts%27-modal-of-ABP-commercial-in-my-custom-template

    You can do it by injecting OPEN_MY_LINK_USERS_MODAL token and executing injected function.

    import { Component, Inject } from '@angular/core';
    import { OPEN_MY_LINK_USERS_MODAL } from '@volo/abp.commercial.ng.ui/config';
    
    @Component({
      /*Component Metadata*/
    })
    export class MyComponent {
    
      constructor(
        @Inject(OPEN_MY_LINK_USERS_MODAL) public openMyLinkUsersModal: () => voi) {}
    }
    

    after this we can call openMyLinkUsersModal in everywhere in component:

    <!-- My Component Template -->
    <button class="btn btn-primary" click="openMyLinkUsersModal()"> Open LinkUsersModal </button>