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

Re : If observable = new can.Observe(foo); then Chrome shows that observable...

I'm still confused by what you are saying.-------------But when we havevar observable = new can.Observe(foo);now observable is said to be an instance of the class Constructor?  But we can't say:...

View Article


Re : If observable = new can.Observe(foo); then Chrome shows that observable...

The ultimate thing is, I don't think the constructor should be named "Constructor"In JavaScript, the constructors are called Object, Person, Worker, Animal, Dog.  It is not called a Constructor or...

View Article


Re : Would the can.Observe really be can.BeObserved?

I was hoping that there were more parallelism here, because for:var Todo = can.Construct({});var observable = new can.Observe({name: "peter"});Now Todo "Can Construct".But observable "Cannot Observe"...

View Article

Re : EJS and @@!!@@

I got a JSFiddle of this working now. It shows the same problem:http://jsfiddle.net/qYdwR/815/

View Article

How to remove controllers without deleting the parent Element?

let´s assume i have a widget area on my webapp<div id="widgetbox">      // my widget goes in here</div>then i start a new controller for it, to make this thing happenweatherWidget = new...

View Article


Re : If observable = new can.Observe(foo); then Chrome shows that observable...

Ok, I did some more research, with the code and output:// sample in  http://jsbin.com/elisoy/12/editvar observable = new can.Observe({});console.log(observable.__proto__ ===...

View Article

Re : How to remove controllers without deleting the parent Element?

So what exactly are you trying to do. What do you mean you want to "exchange" widgets?You can remove the element from the DOM, which will also destroy the Control instance. Or, if you want to keep the...

View Article

Re : If observable = new can.Observe(foo); then Chrome shows that observable...

I also thought of a simpler way to explain:function Person() {}var a = new Person();// use a.__proto__.constructor or a.constructorconsole.log(a.__proto__.constructor)   // => function Person() {}so...

View Article


Re : If observable = new can.Observe(foo); then Chrome shows that observable...

Notwithstanding, why does it matter what the name of the constructor function is?To infer that an Object has the traits of something based on the name of the Constructor is like detecting browser...

View Article


Re : If observable = new can.Observe(foo); then Chrome shows that observable...

You really need to focus on the documentation and less the name of things that chrome's debugging tools are guessing at naming. It's Constructor to imply that the functions returned by can.Construct...

View Article

Re : If observable = new can.Observe(foo); then Chrome shows that observable...

Well, I think it is the fundamentals of programming that1) try to use good names for your variables, class name, etc, etc, if it can help in understanding the code and in debugging and maintenance for...

View Article

Package compiled EJS templates with RequireJS

We're building an application with CanJS and RequireJS. I'm currently trying to package the templates into the optimized app. I have written a small RequireJS plugin which uses the official RequireJS...

View Article

Re : How to remove controllers without deleting the parent Element?

You can remove the element from the DOM, which will also destroy the Control instance. Or, if you want to keep the element in the DOM, you can call destroy on the Control instance to remove the...

View Article


Re : Package compiled EJS templates with RequireJS

i just found can-compile and require-ejs but this doesn't build either. I get this error message:TypeError: Parameter 'url' must be a string, not objectIn module tree:    insposo/insposo...

View Article

Re : How to remove controllers without deleting the parent Element?

We store the initial html of the element as string and replace the element with the original content when the controller is destroyed.can.Control({      init: function(el, options){...

View Article


Re : How to remove controllers without deleting the parent Element?

another way is (thats what i´ve done) to first add a wrapper inside that element you want to attach a Controller:<div id="widgetbox"></div>then..// add new element...

View Article

Re : Package compiled EJS templates with RequireJS

A can-compile issue would have been helpful ;) I released a new version that should work again. Looks as if ZombieJS file URL parsing changed in Nodel 0.10 so I dropped it and use straight JSDom.The...

View Article


Re : EJS and @@!!@@

It looks like your template params are being sent to the .html() function instead of can.view(). jQuery's .html() ignores it, so I suspect the @@!!@@ might just be the result of rendering a template...

View Article

Re : EJS and @@!!@@

Edit: No bug.spautz caught your mistake. If you render it that way it works :)

View Article

I can't get my view to work, it doesn't do anything at all.

So for now I have these models:steal('jquery/model').then(function($){    $.Model.extend('Article',{},{});    $.Model.extend('Widget', {}, {});    $.Model.extend('BlocksPage', {}, {});...

View Article
Browsing all 3491 articles
Browse latest View live