Giter Club home page Giter Club logo

Comments (5)

kkaefer avatar kkaefer commented on August 19, 2024

Call this from the template code that requires the partial. See https://github.com/mapbox/tilestream/blob/master/templates/Map._#L2 for an example.

from bones.

alduro avatar alduro commented on August 19, 2024

Thanks kkaefer for your answer.

please see this code https://gist.github.com/1076231

What did I miss where ?
Thanks again.

from bones.

kkaefer avatar kkaefer commented on August 19, 2024

From the error in that file, the include of the partial seems to happen just fine. However, search_label isn't defined in the template arguments, so it throws an error. Can you paste the contents of /views/Home.server.bones? I can only see the Search view, not the Home view

from bones.

alduro avatar alduro commented on August 19, 2024

views/Home.bones

view = Backbone.View.extend({
el: 'view',
initialize: function(){
this.render();
}
});

Home.server.bones:

views['Home'].prototype.render = function() {
this.el = templates.Home();
return this;
};

from bones.

alduro avatar alduro commented on August 19, 2024

well, it works now:
views['Home'].prototype.render = function() {
var variables = { search_label: "My Search" };
this.el = templates.Home(variables);
return this;
};

where should I put events for Search template ?

/views/Search.bones
view = Backbone.View.extend({
initialize: function(){
this.render();
},
events: {
"click input[type=button]": "doSearch"
},
doSearch: function( event ){
// Button clicked, you can access the element that was clicked with event.currentTarget
alert( "Search for " + $("#search_input").val() );
}
});

or perhaps I should put events into Home.bones instead.

Thanks. I have found this FW + bones-auth + bones-admin the only one that works with models on client and server side and against CouchDB. Quite helpful.

from bones.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.