Is there a way to set a template for a can.Component through a parameter?
Hello All,I would like to pass in a parameter to a can.Component as the template to render or use a default view similar to what I can do with can.Control:can.Control.extend({ defaults: {...
View ArticleRe : Mustache {{>key}} doesn't accept partials in options
You can also use a helper to render a partial provided in your scope. We have two nice ones, one for keeping the scope and one for making an isolated...
View ArticleUse Function in {{#if}}
Hi,Could you tell me if it is possible to do following in Mustache template:Use function in {{#if}}, for example:Tweet = can.Model({ hasImage: function() {return true}});<script...
View ArticleRe : Use Function in {{#if}}
Yes, that works.However, if you want it to live-bind to other data on your model, you should wrap the function in can.compute()
View ArticleRe : Is there a way to set a template for a can.Component through a parameter?
you can use <content>can.Component.extend({ ... tag: 'my-component', template: '<content/>' ...});<my-component> {{someContent}}</my-component>
View ArticleAccess the raw model in can.Model.create()
I have a reference to another model in my newly created model. It seems to me that serialization fails to work in this situation, it replaces this reference with an empty object.Is it possible to...
View ArticleRe : Access the raw model in can.Model.create()
because can.Model is type of can.Map so the attributes plugin may help you solve this issue.http://canjs.com/docs/can.Map.attributes.html
View ArticleSteal: how to reload a module?
How to correctly reload new version of module with steal?I'm implementing live refresh of my application when some source file of the module changes, page is notified of the change. I want to reload...
View ArticleRe : Is there a way to set a template for a can.Component through a parameter?
Thanks for the reply. I will give this a shot and report back with results!
View ArticleCanJS Europe?
I'm going to be in Brussels April 16th to April 30th and London May 1st to May 7th. Anyone in or near these cities want to sponsor a CanJS meetup? Or, is anyone interested in helping me find a space?
View ArticleInput validation
Hi,I recently started using CanJS 2.0.5 with Rails 4.0and I developed (to learn CanJS) a bootstrap 3 input widget Now I want to implement some basic input validation like input is requiredinput min...
View Articlecontroller not executed after a recall
Hi, I am working on a website right now that use 1 controller that display a content manufactured by a widget controller. The Widget is called when you click on an element it works once but when you...
View ArticleAttach model to dom in a Mustache template {{el -> CODE}}
In EJS I attached my models to a div like this:<%list(items, function(item) {%><div class="item" <%=(el) -> el.data('model',...
View ArticleRe : Attach model to dom in a Mustache template {{el -> CODE}}
You'll want to use the data helper in Mustache.{{#items}} <div class="item" {{data 'model'}}>{{name}}</div>{{/items}}
View ArticleRe : Attach model to dom in a Mustache template {{el -> CODE}}
Thanks, that is what I needed!
View ArticleBest convention for re-render/update of part of section
Trying to determine how to best handle a scenario where i don't want excessive views but want to be able to re-render a portion of a section I have a control bound on. I'm haven't gotten into much...
View ArticleRe : Input validation
Use the can.map.validations plugin. Then in each model class's init() method you can declaratively set the validations with this.validate(), this.validatePresenceOf(), this.validateFormatOf(),...
View ArticleRe : Input validation
This is probably not going to be helpful, but I wanted to start to write down my thoughts on validation because I'd like to make a nice validation plugin for 2.2 using 2.1's custom attributes.I'm very...
View ArticleUpdating model: replacing can.List attribute
When new model data arrives from server attributes of current model instance in store are replaced with new ones.Isn't it would be more correct to use list.replace for can.List attribute and how its...
View Article