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
1
vote
0 answers

canjs mustache templates showing __!!__ __!!__ in the output

canjs mustache templates showing !! !! in the output. I just don't understand where it is coming from. I tried using the following code in mustache template. It shows !! !! above the table header and not showing anything in tbody. If I use #each !!…
prasadmsvs
  • 1,621
  • 4
  • 18
  • 31
1
vote
1 answer

routing in canjs not working as links are not getting an href value

I am new to canjs and following the tutorials on canjs site. I am using webpack to create a sample canjs page. import { Component, stacheRouteHelpers } from "can"; Component.extend({ tag: "my-app", view: `
prasadmsvs
  • 1,621
  • 4
  • 18
  • 31
1
vote
1 answer

Google maps API issue with version 3.35 in a django form field widget

I am having a problem with the Google maps API, after upgrading it to version 3.35. The goal is to display the map in a form so that the user can define the geolocation. I am using Django 1.11.12 and CanJS 2.0.2. Here is the code (reduced for…
apiljic
  • 527
  • 4
  • 14
1
vote
0 answers

Handle NDJSON Stream Promises in Stache Can.js

I have this streaming API endpoint: https://step3-ndjson-stream-api-demo.glitch.me/ I try to render with can.js NDJSON stream and following the example got some success output to console.log but only the first object. Here's my app.js…
Ardhi
  • 2,855
  • 1
  • 22
  • 31
1
vote
1 answer

Navbar not sizing to fit mobile screen

Here is my site https://cleveroscar.github.io./ I want to make my navbar fit the mobile screen to be usable, but when tested on my iphone the navbar is super tiny, check on dev tools to see what I am talking about, here is the code below, I am using…
1
vote
2 answers

How to use CanJS with VelocityJS?

I'm using CanJS (with StealJS) to build a quizz app, and I have quizz-question component that is rendered for each question! I wonder how to make a transition with velocityjs each time quizz-question component is removed for answerd question and…
Cherif BOUCHELAGHEM
  • 1,126
  • 2
  • 14
  • 21
1
vote
1 answer

How to use debounce function with CanJS DefineMap view-model method?

I'm trying to use lodash _.debounce function for canjs DefineMap view-model method but it seems that this is tricky even I tried to do it in the init method but without success: export const ViewModel = DefineMap.extend({ init() { this.myMethod =…
Cherif BOUCHELAGHEM
  • 1,126
  • 2
  • 14
  • 21
1
vote
1 answer

Javascript sort items excluding some specific items

I am trying to sort some items (sort a map) , I can sort it successfully, but I want to exclude some items based on it's attribute Right now I am sorting like this based on attribute - price return (product.attr('active') !== 'f' …
Cowgirl
  • 1,454
  • 5
  • 19
  • 40
1
vote
1 answer

CANJS3 multiple instances of a component

With CanJS (3), I'm trying to insert twice the same component, but with a different behavior. The 'parent' stache looks like :
<...>
Nathan
  • 71
  • 8
1
vote
2 answers

CanJS - Two way binding

How to do two-way binding using CanJS? Enter the Text : Display the Text: {{enteredText}} Can show multiple approaches? Using ViewModel ?
Santosh
  • 875
  • 5
  • 14
  • 33
1
vote
1 answer

Calculated value not being updated correctly using donejs

I have standard donejs project with a component and a model both created using the default generators like this: donejs add component storyBoard story-board donejs add supermodel story I left a sample project here:…
nico
  • 144
  • 12
1
vote
2 answers

How to find which option is selected in selectpicker plugin of bootstrap in canJs?

I am using the selectpicker plugin of bootstrap. Now i want to find which option is selected or deselected last.