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
BairDev
  • 2,865
  • 4
  • 27
  • 50
0
votes
0 answers

CanJS Live Binding with lazy load of Components Not working

I'm using headJs to lazy load scripts. For simplicity lets say I have 3 components, layout-component(tag : custom-layout), custom1-component(tag : custom-one) and custom2-component(tag : custom-two). index.html
pravin
  • 1,106
  • 1
  • 18
  • 27
0
votes
1 answer

Canjs: Databind not finished

I have a nested component. The parent component set's a property in the scope of the child component: In the child component i listen on the change event of the layer "{scope} layers":…
cpiock
  • 1,275
  • 2
  • 17
  • 44
0
votes
1 answer

How create gmail like common control bar in Canjs?

For example we make a Gmail clone in canjs. Consider each item in the sidebar being rendered with a component of its own. Now I want a single control bar just like gmail to control the activities inside the components. How should I approach it??? At…
Abhilash Nanda
  • 339
  • 2
  • 4
  • 13
0
votes
1 answer

canjs component tempate dom live binding

My code is to realize a paginate page like this example, https://github.com/bitovi/canjs/blob/master/component/examples/paginate.html . I found the {#messages}...{/messages} in message.mustache template was not been inserted into page , while…
0
votes
1 answer

how can can.component returning value to user?

Problem: I am building a component where i just need output json object. How can i expose that output so that code can just call component and retrieve that value? (eg. like a getter value) For e.g. can.component of tree combo as defined over here…
0
votes
1 answer

canjs model not populating mustache template

I am very new to CanJs just started learning, I am struck with below problem not able to debug it. I have model as below: Localized = can.Model({ findOne : 'GET /resources/localized' }, { }); GET /resources/localized ---> fetches…
Abhi
  • 38
  • 5
-1
votes
1 answer

Canjs changed event

Is there a way to detect list change in canjs and make the view redraw? I am changing the list but this is not shown on screen. At the moment i have view model TodosListViewModel = can.Map.extend({ todoCreated: function(context, element) { //…
php--
  • 2,647
  • 4
  • 16
  • 18