Questions tagged [canjs]

CanJS is an MVC/MVVM library for JavaScript with modern features like live-binding and computed values.

CanJS is an open source JavaScript MVC framework for professional JavaScript developers who need advanced capabilities in an easy-to-use package.

CanJS emphasizes writing quality code that results in maintainable, fast applications. It includes templates with two-way binding, observables that connect to a RESTful JSON interface, and routing/deep linking support.

Links

Asking a question

  • Link to documentation where possible
  • Reduce the problem to the smallest working example
  • Create a JSFiddle or clone this basic one to show functional code

Answering a question

  • If documentation exists on CanJS.com, link to it
  • If documentation does not answer the question, open a new CanJS issue with the Documentation label and link to the question
  • If the question identifies a bug:

CanJS is primarily developed by Bitovi for use in real-world projects.

226 questions
0
votes
1 answer

HTML tags are escaped with mustache templates in CanJS

My requirement is that i need to display a set of options to the user. I have used mustache template to render the options using CanJS javascript framework. The issue here is when i am trying to render a options like: Potato Rs. 12 The mustache…
Aravind
  • 178
  • 6
0
votes
1 answer

Routing in canjs

right now im diving into canjs, it looks like a great mvc framework. I'm having troubles with the router. I'm using wamp for making my tests in localhost. So the problem is the following: when I enter localhost the initial url in the browser is…
rdk1992
  • 406
  • 1
  • 5
  • 20
0
votes
1 answer

CanJs Model Service Method Implementations

I am having trouble understanding how to correctly implement the can.Model service methods. I currently have this var Foo = can.Model({ findAll: "GET /service/Editor.svc/foo", findOne: "GET /service/Editor.svc/foo/{id}", create: 'POST…
ford prefect
  • 7,096
  • 11
  • 56
  • 83
0
votes
2 answers

can.routing : triggering a change to go from #!/foo/bar to #!/foo

I am trying to understand CanJS' routing. So far, I have the following routes set up. can.route('plant/:plant/', { plant : undefined, day : undefined }); can.route('plant/:plant/day/:day', { plant : undefined, day : undefined }); I…
oligofren
  • 20,744
  • 16
  • 93
  • 180
0
votes
1 answer

How to convert json array to json object in js

Actually i am trying to populate a list of years using canjs. CATEGORIES is the existing json object var CATEGORIES = [ { id: 1, year: '1983' }, { id: 2, year: '1984' }, { id: 3, …
sasi kanth
  • 2,637
  • 4
  • 17
  • 29
0
votes
1 answer

canjs attach Control for element in Observe.List after render

Generally the problem is that my click action in Control doesn't work. In codes below you can see situation when i generate list with items using Observe.List, so it's updated when new element occurs on the list automatically (view below) and it's…
0
votes
1 answer

Global AJAX event listeners in Can.JS?

Is it possible to bind listeners to when an AJAX request is started in Can.JS? I want to integrate a little loading indicator in my Can.JS project so that users can see when data is being loaded from my server. Using the jQuery $.ajaxStart and…
Leo Bernard
  • 174
  • 1
  • 9
0
votes
1 answer

Error in instantiating canjs controller using requirejs

I am using canjs and require js to create a mvc application. I am new to both of them. I have created a base js class --home.php and loaded jquery, canjs and requirejs in home.php. I have two separate folders named controller and model in the model…
Abhishek Prakash
  • 201
  • 1
  • 3
  • 11
0
votes
1 answer

How to make can.Model send JSON data when update?

I have this code: var SotriesModel = can.Model.extend({ findAll: 'GET /api/stories/', create: function(story) { console.log(story) return $.ajax({ url: '/api/stories/', type: 'POST', …
nvcnvn
  • 4,991
  • 8
  • 49
  • 77
0
votes
1 answer

CanJS - how does the views .ejs get populated at the index.html

I've just started with CanJS. After viewing a tutorial from http://net.tutsplus.com/tutorials/javascript-ajax/diving-into-canjs/ I was wondering how does contactsList.ejs knows where to place it's data inside index.html? It placed it's data…
Steve Ng
  • 1,189
  • 1
  • 13
  • 35
0
votes
1 answer

CanJS view return @@!!@@ if view contain HTML table

I'm using http://canjs.com/ lasted version with Chromium 28.0.1500.71 (Developer Build 28.0.1500.71-0ubuntu1.12.10.1) Ubuntu 12.10 For example, I have this template script: