Note that there are some explanatory texts on larger screens.

plurals
  1. POemberjs menu change content
    primarykey
    data
    text
    <p>I have menu:</p> <pre><code>&lt;ul&gt; &lt;li&gt;&lt;a&gt;menu1&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a&gt;menu2&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a&gt;menu3&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>I have contents:</p> <pre><code>&lt;script type="text/x-handlebars" data-template-name="content1"&gt;text1&lt;/script&gt; &lt;script type="text/x-handlebars" data-template-name="content2"&gt;text2&lt;/script&gt; &lt;script type="text/x-handlebars" data-template-name="content3"&gt;text3&lt;/script&gt; </code></pre> <p>And site:</p> <pre><code>... header menu &lt;div id="content"&gt; &lt;!-- there is a place for content from emberjs .appendTo() i guess should be used? --&gt; &lt;/div&gt; footer ... </code></pre> <p>If user click "menu1": see "content1" and "menu1" get css class "menu-active". If clck "menu2": see "content2" and "menu2" get css class "menu-active" etc.</p> <p>Important information: "content2" will generate data in emberjs too. Ofcourse when click "menu1" and later "menu2": effects menu1 have to disappear.</p> <p>I am confuse how to coretly use that.</p> <p>For menu should i extend class View or Controller?</p> <p>I tried:</p> <pre><code>&lt;li&gt;{{#view App.MenuView}}&lt;a {{action "show" content="content1" }} &gt;content1&lt;/a&gt;{{/view}}&lt;/li&gt; </code></pre> <p>Better will be without "li" etc.? I guess better way is when emberjs generate</p> <pre><code>"&lt;li&gt;&lt;a&gt;...&lt;/a&gt;&lt;/li&gt;" </code></pre> <p>so i should do something like</p> <pre><code>{{... menu="menu1" content="content1"...}} </code></pre> <p>I dont fill how to do this in right way.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload