Re : Best practice for passing references to a can.Component instance
Tom, You're right, but I might say it's the beautiful thing about the observer pattern. You interact with your observables/data.Steven, Have you checked out the tabs example from can.Component's...
View ArticleRe : I'm confused what can.Components are meant for
The really big advantage of can.Component is it's nestability and declarative nature. Previously, if you had the need for sub-controllers, you were stuck either setting them up outside of your...
View ArticleRe : can.Component and "jQuery Mobile component refresh"
You can trigger jquery event on the nested elements (components) and catch those events them in one place (in parent component) and there trigger jquery refresh (maybe using setTimeout to ensure that...
View Article404 Not Found At the time of Saving
var Todo = can.Model({ findAll: 'GET /todos', findOne: 'GET /todos/{id}', create: 'POST /todos', update: 'PUT /todos/{id}', destroy: 'DELETE /todos/{id}' }, {})undefinedvar todo = new Todo{(name: "Pick...
View Articlecan.Component change event for array changes (to existing objects) is not...
I noticed that if I have an array of objects in my scope the change event is not triggered if I change one of the existing objects.It is however triggered if I add to or remove from the array.If this...
View ArticleRe : can.Component change event for array changes (to existing objects) is...
Here is a fiddle that describes the problem: http://jsfiddle.net/basicguy/9c2CJ/2/In '#trigger click' I have 2 scope updates that don't have any effect.The third update (adding a new object) works...
View ArticleRe : can.Component change event for array changes (to existing objects) is...
Try can.List.splice method like http://jsfiddle.net/9c2CJ/3/
View ArticleRe : can.Component change event for array changes (to existing objects) is...
Thanks a lot, now the update works as I want it.That still leaves open the question about the scope change. Shouldn't this have been triggered in the child component?
View ArticleRe : Global context variables for all templates?
Justin, cool, thanks!Tom, but then it must be defined for every template, when most of them could make use of it.
View ArticleRe : No reference to can.List index in can.Component scope arguments?
Tom, I like that idea. If there were a way to disable automatic event delegation of can-{event} in a can.Component, we could have the best of both worlds.
View ArticleNo this.element in can.Component.scope like can.Control?
can.Control has this variable and it's very handy when you need to do DOM stuff.Is there any other way to access the element without having to define scope with a custom function?:scope:...
View ArticleRender simple mustache template as scope value?
First off, I can't get it to work without [object DocumentFragment] being rendered.Second, is it a bad idea to even do what I'm trying to do:can.Mustache.registerHelper("route-root", function(){ return...
View ArticleRe : Render simple mustache template as scope value?
For rendering a template string you have to use the actual engine (can.view.mustache) because can.view will normally try to look up the string as a filename. The engine will return a renderer function...
View ArticleRe : Render simple mustache template as scope value?
Awesome, thanks!For anyone finding this via search, here's my shortened finished code:scope.items.push({ message: can.view.mustache(message).render({}), something: true});
View ArticleFuncunit testing process that switches from http to https.
Hello,I am trying to write a script that exercises the checkout process on one of my employers websites. I have noticed that when navigation to the secure side of the process occurs where a user would...
View ArticleRe : No this.element in can.Component.scope like can.Control?
can.Component has access to an init function, since it's extending can.Control. Awesome stuff!init: function(element, options){ this.scope.attr("element", element);},scope:{ something:...
View ArticleRe : No this.element in can.Component.scope like can.Control?
Your scope should really be independent of elements for the most part. For example, I often create a separate, easily unit testable Map constructor that I use as my scope.For instance: Turnstile =...
View ArticleRe : No this.element in can.Component.scope like can.Control?
I don't understand how a separate scope is any better than an integrated scope for unit testing.The reason I need element references in my scope is for can.batch.start( function(){ /* DOM stuff */ } ).
View Articlesteal a file and get its reference as an object
Hi, Can I steal a file and get its reference as an object?something like..var HomeController = steal('js/controllers/HomeController.js');var hc = new HomeController();Is something like this possible...
View Articlestealjs/canj
Hi guys,I have a project running stealjs and canjs.Everything works 100% in IE (10) and Chrome. Howver when I build the javascript into a single file, Chrome keeps working but IE seems to die....
View Article