Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to add New Component to Nav Items #25

Open
Ibrahimogod opened this issue Jan 5, 2024 · 3 comments
Open

Not able to add New Component to Nav Items #25

Ibrahimogod opened this issue Jan 5, 2024 · 3 comments

Comments

@Ibrahimogod
Copy link

Ibrahimogod commented Jan 5, 2024

I tried to use NavItemsService to add new Componet to the top right nav items but it's not being rendered don't know what is the reason, I tried the same with UserMenuService and It worked fine but I don't need it there, however I tried another solution to replace the Language Selection Component using ReplaceableComponentsService with a new Component which should include both the Language Selection Component and My New Component and it's rendered but the issue is I can't reuse the Language Selection Component,
I tried to use the selector <abp-language-selection> </abp-language-selection> and <lpx-language-selection></lpx-language-selection> but both can't be found or treated as existing Components

@ismcagdas
Copy link
Member

Could you share your original code with NavItemsService ?

@Ibrahimogod
Copy link
Author

Could you share your original code with NavItemsService ?
this is my AppComponent

import { NavItemsService } from '@abp/ng.theme.shared';
import { Component } from '@angular/core';
import { NotificationComponent } from './notification/notification.component';

@Component({
  selector: 'app-root',
  template: `
    <abp-loader-bar></abp-loader-bar>
    <abp-dynamic-layout></abp-dynamic-layout>
  `,
})
export class AppComponent {
  constructor(private readonly navItems: NavItemsService) {
    this.navItems.addItems([{
      id: 'NotificationComponent',
      component: NotificationComponent
    }])
  }
}

and this is my Other component

import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-notification',
  templateUrl: './notification.component.html',
  styleUrls: ['./notification.component.scss']
})
export class NotificationComponent implements OnInit {
  ngOnInit(): void {
    console.log('NotificationComponent#ngOnInit');
  }
}

the console.log('NotificationComponent#ngOnInit') is not logged and if I added anything to the notification component template it's not being rendered

@ismcagdas
Copy link
Member

@masumulu28 can you take a look at this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants