html - Google Polymer create menu tree -


I want to create a menu tree using the polymer core-menu. The table in my database is:

Enter image details here

The table has a category with sub category. I want to show it as a menu tree, I did something like this:

  & lt; Polymer-element name = "category-list" attributes = "show" & gt; & Lt; Templates & gt; & Lt; Style & gt; : Host {Display: Block; Width: 100%; } .cat_item {margin: 10px; Background color: RGB (255, 255, 255); } & Lt; / Style & gt; & Lt; Category-service id = "service" categories = "{{categories}}" & gt; & Lt; / Category-services & gt; & Lt; Selected core-menu = "1" selected index = "1" id = "core_menu" & gt; & Lt; Template repeat = "{{category in categories}}" id = "t" if = "category.has_child == '1'" & gt; & Lt; Core-Submenu label = "{{category.category_name}}" icon = "settings" value = "name" category = "cat_itum" & gt; & Lt; Template ref = "t" repeat = "{{range in categories}} = if =" category.parent_id! = '0' ">      

but I can not use "if", I do something wrong. I need to display the sub item using the Database table field Example:

  if (category Has_child == ' 1 ') // display if (category.parent_id! = 0) // display   

I found the official example: