Hi Gaurav,

Let me also take a shot at this.

If I understand this properly, you want to have a Core module which 
provides NavBar as a navbar component, which can go horizontally or 
vertically. Additionally, the items in navbar are implemented as NavBarItem 
components. Perhaps you also have a NavbarService which gives programatic 
access to these two components. So now you publish the module and build 
another app to use it.

First, you want to be able to configure NavBar (parent component) as needed 
- that should be quite doable, a simple @Input() layout = 'horizontal'; 
will do these things.

Now the trickier part, in this new apop, you want the NavBar component from 
Core, but you want your own custom nav item instead of the core NavbarItem 
- right? For that, I think something like this could work:
Parent, NavBar uses 'nav-bar-item' as a selector. So in your new app, you 
import NavBar, but declare CustomNavItem with the same selector, which 
extends the original NavBarItem. Similarly in this custom module you can 
provide CustomService as an implementation of NavBarService, again, 
extending it first and overriding the methods you want altered.

And then export it all as a new module. And your app uses this other module 
instead of the original one.

I'm pretty sure most of this should work without fuss.

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to