ember.js - How to do a dynamic site menu? -


let me explain i'm trying do, basics

so, app has top menu bar

this is, various host of reasons, defined externally, , structure available via rest api:

app.menu = ds.model.extend({   parent: ds.belongsto("app.menu"),   children: ds.hasmany("app.menu"),   link: ds.attr("string"),   route: ds.attr("string"),   title: ds.attr("string")}) 

i need something, run, when app starts up, app.menu.find(), , take collection, , iterate on in template, included in application template.

controller didn't work

view didn't work, can't seem figure out collectionviews

even embedding right in application template isn't working there's no collection @ point

actually, make more interesting, each menu item has many children , ideally call subtemplate each child, recursively

when app loads, goes root state router. want start looking.

http://emberjs.com/guides/routing/setting-up-a-controller/

you can setup controller , retrieve menu.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -