javascript - Model parameter takes no effect in {{render}} helper -
The second parameter should be a model, but in my example there is no effect:
Template: < / P>
& lt; Script type = "text / x-handlebars" data-template-name = "guestbook" & gt; {{#each}} & lt; div class = "visitor-lee" & gt; & Lt; div class = "user-name" & gt; {{Name}} & lt; / Div & gt; & Lt; Div class = "clear" & gt; & Lt; / Div & gt; & Lt; / Div & gt; {{/ Every}} & lt; / Script & gt; & Lt ;! - End with x-handle bars - & gt; Javascript:
window.WorkBench = Ember.Application.create ({}); Workbank. Application Editor = DS Fixtures adapter.andend (); WorkBench.Guestlist = DS.Model.extend ({name: DS.attr ("string")}); WorkBench.Guestlist.FIXTURES = [{id: 1, name: 'aa'}, {id: 2, name: 'BBB'}, {id: 3, name: 'ccc'}]; WorkBench.GuestlistController = Ember.ArrayController.extend ({}); html
& lt; Div id = "con_taba_1" & gt; {{Render "guest" guest's}} & lt; / Div & gt; A list should be displayed, but none. I know, thank you, why!
The second parameter should actually be present in the context where you are using it. You are going through an undefined property
One way to prove this is to just log out of guest list & lt; Div id = "con_taba_1" & gt; {{Log guest}} {{render "guestlist" guestlist}} & lt; / Div & gt; The guest needs to be present in the amount where you are using the render statement, the reference to this Can be seen by logging in> (I tell you, but you have left that information). & lt; Div id = "con_taba_1" & gt; {{Log in}} {{log guestbook}} {{render "guestlist" guestlist}} & lt; / Div & gt; Typically the model information is given from the route hook related to the reference above the model . app.furoots = MR Route. Extension ({Model: Function () {Returns {Bar: 'False'};}}); In the foo template you can {{log time}} and you will see baz . There is a playground for you to install it,
html वेब डिज़ाइन उदाहरण कोड
ReplyDeleteअवरुद्ध और संरक्षित कोड