在subnav我想創建一個組件,如果它的這個(/公司)鏈接,顯示我subMenus按鈕。Angular2 navbar-subnavbar,檢查導航欄鏈接後顯示subnav菜單
Navbar的部件:
export class NavbarComponent implements OnInit
{
navbar = [
{
name: 'Company',
link: '/company',
subMenu: [
{ name: 'test1', link: '/test1'},
]
},
{
name: 'About',
link: '/about',
subMenu: [
{ name: 'test2', link: '/test2'},
]
},
就是答案有幫助??? – Aravind