Questions tagged [canjs-component]
15 questions
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
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
1 answer
How can I access the attribute from the template?
In this example i'm expecting it to say "hello world" but the world isn't picked up from the saying attribute.
(function () {
'use strict';
$(function () {
// Set up a route that maps to the `filter` attribute
…

Joseph Le Brech
- 6,541
- 11
- 49
- 84
0
votes
0 answers
CanJS - correct way to pass a callback from the viewmodel to the stache file
I have an old CanJS component which is renders a React component, and where now I need to pass a callback.
I found a way to pass the callback but I feel it's not the best way because in some cases it seems that the viewmodel reference is not the…

Ninita
- 1,209
- 2
- 19
- 45
0
votes
1 answer
How to get values from dynamically generated form elements
In canJs we use can-value to bind values of an element to controller.
//In controller
scope.attr("parameter") // It will give the value
//In mustache
But how do we bind values of dynamically generated…

prasadmsvs
- 1,621
- 4
- 18
- 31
0
votes
1 answer
'inserted' event not fired for Component (CanJS, JSFiddle)
For some reason the inserted event is not fired for any component in my set-up in this fiddle.
I'm trying to play with view bindings here, but the basic (hard coded) data aren't produced and used at all. No console.log line of a callback of an…

BairDev
- 2,865
- 4
- 27
- 50
0
votes
1 answer
XML Parsing Error for stache file, used in Tutorial (v2)
I'm currently stating to learn CanJS with the v2 tutorial.
The of the index.html consists of the following lines