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

Re : steal a file and get its reference as an object

That specific syntax isn't supported, but stealing a file and getting its reference as an object is the main use of steal. You have to use an asynchronous...

View Article


Re : 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. Easy swapping? Because you can test Scope object functionality separately, so you don't need a component...

View Article


"nullrouter": can.route without routing

This is one part "hey, things didn't quite work right", one part "here's a hopefully-not-too-ugly workaround", and one part braindump. We're using canjs 2.0.3.This is rather long; there's nothing too...

View Article

Re : No this.element in can.Component.scope like can.Control?

I don't understand, I am using can.batch, albeit inside the scope. Where else would I put DOM stuff if it needs to be initiated every time a specific scope function is called?

View Article

Re : Global context variables for all templates?

Well, it would be available for sub-templates and component templates, but yes, every top-level template will need separate variables defined. Create a helper for constructing urls.

View Article


Re : Global context variables for all templates?

Ah, good idea! While I've already created a helper that supplies the root value, creating one that constructs a URL is even better. Thanks!

View Article

Re : No this.element in can.Component.scope like can.Control?

Usually your DOM live bound to scope's state, so it updates when scope attributes are changed. If you need some additional DOM related procedures you can do it in event handlers that handle specific...

View Article

Re : stealjs/canj

Hi Robert,Can you paste the actual error with the stack trace?  That's not enough info to be able to help.Thanks,Brian

View Article


Pretty urls

I read tutorial and guides on Canjs, but I am still blur and also new in JS / Canjs. I am trying to find a way to listen to the dropdown menu and change the url accordingly with pretty url links. So...

View Article


Re : Pretty urls

Hey there, what kind of dropdown-menu are you talking about? Do you mean a select-box, such as this one: some option some other option Or are you talking about a (bootstrap?) dropdown, as shown here:...

View Article

Re : No this.element in can.Component.scope like can.Control?

Think of the scope as data that is live bound to your component and nothing more. As alex said, there is the events property for placing custom DOM manipulation. There you have access to the dom and...

View Article

Re : No this.element in can.Component.scope like can.Control?

@Matthew I wouldn't think of use of the "events" as a bug. I agree it is mostly not needed, but it is also the only way you can integrate 3rd party widgets (like file uploader) with the can.Component.

View Article

Re : No this.element in can.Component.scope like can.Control?

Ummmmmm what? Events is absolutely needed, and for a number of reasons. Declarative binding of event handlers, while cute, doesn't make sense with any dom heavy use case. Event delegates are still...

View Article


can.route.url creates invalid url

When building a url usingcan.route.url( {controller: 'user', action: 'login', returnUrl: returnPage}, false )can force-encodes the whole url. Whereas one would expect the url to be:...

View Article

created subscribe method not being called in the controller.

Hi All,I am trying to get my created subscribe called but it fails to do so. Below is my code. Any sort help would be highly appreciated. I have spent two days on this and now absolutely clueless....

View Article


Re : Pretty urls

Hi Thanks for quick reply. Please bear with me. I think that dropdown menu is used from purecss.io. Currently the <a> tag would have /flat+type=Apartments. Did you mean that I need to change it...

View Article

Best way to integrate 3rd Party jquery Plugins

Hello,What is the best way to integrate 3rd party plugins to a controller? Specifically, I want to add and remove them through a controller so that they do not cause memory leaks. I also would like to...

View Article


Re : can.route.url creates invalid url

You can use can.route to define templates for pretty urls. In your case, that would be can.route(":controller/:action"). Can.route.url simply matches from available templates if any, and then...

View Article

Re : can.route.url creates invalid url

I resolved this by providing a specific route. This seems to do the trick.can.route( 'user/:action/:returnUrl', { controller: 'user' } );

View Article

Re : Pretty urls

You have a couple of options here. Setting a hash url is basically the same as calling can.route.attr with removeOthers set to true. The destructive way of doing this would be to simply have hard links...

View Article
Browsing all 3491 articles
Browse latest View live