Tabmenu error

UI Components for Angular
Post Reply
nikos6707
Posts: 4
Joined: 30 Aug 2018, 13:18

31 Aug 2018, 13:11

Hi, i am trying to use tabmenu but i am getting the following error:

Code: Select all

TabMenu.html:4 ERROR Error: StaticInjectorError(AppModule)[RouterLinkWithHref -> Router]: 
  StaticInjectorError(Platform: core)[RouterLinkWithHref -> Router]: 
    NullInjectorError: No provider for Router!
    at NullInjector.push../node_modules/@angular/core/fesm5/core.js.NullInjector.get (core.js:1062)
    at resolveToken (core.js:1300)
    at tryResolveToken (core.js:1244)
    at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (core.js:1141)
    at resolveToken (core.js:1300)
    at tryResolveToken (core.js:1244)
    at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (core.js:1141)
    at resolveNgModuleDep (core.js:8376)
    at NgModuleRef_.push../node_modules/@angular/core/fesm5/core.js.NgModuleRef_.get (core.js:9064)
    at resolveDep (core.js:9429)

foolball
Posts: 7
Joined: 14 Aug 2018, 01:41

31 Aug 2018, 22:45

Can you provide more code?

nikos6707
Posts: 4
Joined: 30 Aug 2018, 13:18

03 Sep 2018, 10:03

HTML code:

Code: Select all

<p-tabMenu [model]="items" [activeItem]="items[0]"></p-tabMenu>
TS code:

Code: Select all

activeItem: MenuItem;

	constructor() { 
		this.system_versions = [
			{ id: 1, name: 'Daily Operation'},
	  		{ id: 2, name: 'Mass Notification'}
  		];

  		this.items = [
  			{ label: 'Dashboard1', icon: 'fa fa-desktop'},
			{ label: 'Dashboard2', icon: 'fa fa-desktop'},
			{ label: 'Dashboard3', icon: 'fa fa-desktop'},
			{ label: 'Dashboard4', icon: 'fa fa-desktop'},
			{ label: 'Dashboard5', icon: 'fa fa-desktop'},
			{ label: 'Dashboard6', icon: 'fa fa-desktop'},
			{ label: 'Dashboard7', icon: 'fa fa-desktop'}	
  		];

  		this.activeItem = this.items[2];
  		
	}

User avatar
sudheer
PrimeFaces Core Developer
Posts: 4345
Joined: 16 Oct 2011, 19:19
Location: Singapore

03 Sep 2018, 15:24

You should have to provide *.route.ts code as well.
Author,Speaker
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/

___________________
Sudheer Jonna

foolball
Posts: 7
Joined: 14 Aug 2018, 01:41

18 Sep 2018, 21:15

This was resolved by providing the route.

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests