Base solution for your next web application
Open Closed

How to import Admin Module In User Module. #4550


User avatar
0
velu created

Hi,

We are trying to call admin module like, loginAttemptsModal , changePasswordModal , changeProfilePictureModal Inside dashboard or any page which has been added in the main folder (scope of main.module.ts).

But we have parser error,

Please help us to solve this.

Thanks


10 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    @velu can you also share the error message ?

  • User Avatar
    0
    velu created

    Hi,

    Add child module inside in the page. HTML CODE

    </div>
            </div>
        </div>
        <mySettingsModal #mySettingsModal (modalSave)="onMySettingsModalSaved()"></mySettingsModal>
    </div>
    

    Error

    ERROR Error: Uncaught (in promise): Error: Template parse errors:
    'mySettingsModal' is not a known element:
    1. If 'mySettingsModal' is an Angular component, then verify that it is part of this module.
    2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
            </div>
        </div>
        [ERROR ->]<mySettingsModal #mySettingsModal></mySettingsModal>
    </div>
    "): ng:///MainModule/SettingLandingComponent.html@68:4
    Error: Template parse errors:
    'mySettingsModal' is not a known element:
    1. If 'mySettingsModal' is an Angular component, then verify that it is part of this module.
    2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
            </div>
        </div>
        [ERROR ->]<mySettingsModal #mySettingsModal></mySettingsModal>
    </div>
    "):
    

    Thanks

  • User Avatar
    0
    ismcagdas created
    Support Team

    Have you defined it in your *.ts file like this <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/blob/master/angular/src/app/shared/layout/header.component.ts#L46">https://github.com/aspnetzero/aspnet-ze ... ent.ts#L46</a> ? If so can you share your ts file content ?

  • User Avatar
    0
    velu created

    HI, We have added all component inside the header.ts

    But actually, problem is that.

    Steps we followed -- Add page in this folder --> \app\main\dashboard[bs-ModalPopup.ComponetPage]. -- Register this page inside main.module.ts --Add html componet inside header Html like this (<UserDetails #UserDetails></UserDetails>) --We got an error in this step.

    Issue We found that bs-modal which is declared inside \app\main folder and registered in main.module.ts is not accessible in Header page.

    And the same bs-modal which is declared inside app\shared\layout\ and registered in app.module.ts is not accessible in other paged which is declared in the \app\main folder.

    Our requirement is: Create modal inside \app\main and call this modal from navbar or user drop-down menu.

    Thanks

  • User Avatar
    0
    velu created

    :?:

  • User Avatar
    0
    alper created
    Support Team

    there's the usage of opening modals from header. can you follow up that routine [attachment=0:3i11whha]Screenshot_2.jpg[/attachment:3i11whha]

  • User Avatar
    0
    velu created

    Yes,

    we are trying to open module which is present in this root --> \app\main\dashboard[bs-ModalPopup.ComponetPage].

  • User Avatar
    0
    ismcagdas created
    Support Team

    @velu have you solved your problem ?

  • User Avatar
    0
    velu created

    Hi, The problem is not solved yet, but we move page( bs-modal) in app\shared\layout\ And registered in app.module.ts.

    Its work for me..

    But pages user app.module.ts (only bs-modal) Its not accessible in any user page( like scope of main.module.ts

  • User Avatar
    0
    velu created
    • But pages under app.module.ts

    Like mysettings Change password