Quantcast
Channel: JavaScriptMVC Forum
Browsing all 3491 articles
Browse latest View live

Re : Listen for change on model List aliased to controls options object

Ok, I think the problem happened cause I was aliasing this.options.data.stateParams  to this.state, not, this.options.state.  Does {objectName} selector have scope access to this or just this.options?

View Article


Re : Listen for change on model List aliased to controls options object

{object} selectors have access to this.options, and the root object (i.e. window).See "Templated event handlers Part 1" in http://canjs.com/docs/can.Control.html

View Article


Re : Working with route pushstate

Yes thanks, but you meanthistory.pushState({}, "title", "/en");

View Article

Re : Working with route pushstate

Yes, I did.  Good catch.

View Article

Using Setters To Reject/Prevent Changes

In our Boston meet-up yesterday a question came up about how to prevent changes when the change is invalid or doesn't meet a condition.My solution was to use a setter, but I am interested to hear how...

View Article


Re : Using Setters To Reject/Prevent Changes

You can override attr() to check the values before kicking up to _super(), but I think using the attributes plugin and writing a converter that checks for bad values is a cleaner...

View Article

Re : Using Setters To Reject/Prevent Changes

setter is usually ok for this.

View Article

Model save parameters

If I had a model with update defined:update: 'PUT /api/documents/{_id}?action={action}',to save with PUT request to /api/documents/1234?action=publish I do:modelInstance.attr('action',...

View Article


CanJS + Websockets

Hi AllWe are considering CanJS for a project that involves realtime updating via websockets. For example models should be updated immediately when a message is received from the server thus updating...

View Article


Re : CanJS + Websockets

We also consider using web sockets - any example on how to best integrate it with models would be great.

View Article

Re : CanJS + Websockets

There's a demo on Bitovi's blog which shows something similar to what you describe: Weekly Widget 5 - Real-Time Chat

View Article

Re : CanJS + Websockets

I recently released a REST and SocketIO NodeJS framework called Feathers that ties in very nicely with CanJS. Alexis recently made a cool demo at the DallasJS meetup how to use Feathers to turn an...

View Article

Re : Model save parameters

If the following following adds action to the querystring then I think that's your answer:modelInstance.save({action: 'publish'}) Otherwise can't you just define update as a function as such:update:...

View Article


How to bind event handler to can.Model.List individual item attribute changes?

I would like to set up an event handler which fires every time when an attribute of any item from a can.Model (retrieved by .findAll) has been changed. I can bind handlers to Model changes (add, remove...

View Article

Re : How to bind event handler to can.Model.List individual item attribute...

Sounds like this conversation from a few weeks ago:  https://forum.javascriptmvc.com/#Topic/32525000001547025

View Article


Re : Model save parameters

Well, I wouldn't necessarily say that you should make two separate requests, only that you should maintain a consistent restful api. One issue with trying to merge the two functionalities is that it...

View Article

Re : Canjs LiveBinding with EJS

Not that I'm aware of, however it's generally not that difficult. It really depends on how much logic you have in your templates, which would need to be pulled out entirely. Other than that, it's...

View Article


Re : Canjs LiveBinding with EJS

ok i will try. There is surely no logic in templates. So the future of creating views for canjs would be mustache and not ejs?Also for Javascriptmvc?

View Article

Re : Model save parameters

@Tom SieverdingOk, I mostly got your point.  I wonder should I "invent" here new "publication" resource to maintain REST consistency? At the very least, a reasonable approach is to maintain a...

View Article

Typescript support

Hi,I'm interested in typescript support in canjs. Are there any plans to port canjs to typescript?Thank you,Marko

View Article
Browsing all 3491 articles
Browse latest View live