Variable inside router template


I’m trying to get a value from global array inside router template.

But Its returning “undefined” message. if i add this.

Then it returns id properly. e.g: 8

And when i add plain number inside variable.

That works fine and return category name.

Any suggestion. what am i doing wrong?


Can you show the full template example and where do you use it?