These are chat archives for canjs/canjs

24th
Jan 2019
Piyush Sharma
@Piyush5767
Jan 24 21:20 UTC
in canjs2 there has been issue calling inserted event object - if call have been made dynamically
i am trying to call inserted method dynamically via model box where as the call never been made....
Chasen Le Hara
@chasenlehara
Jan 24 21:25 UTC
@Piyush5767 What does it mean to call the inserted event object?
Piyush Sharma
@Piyush5767
Jan 24 21:26 UTC
events: {
inserted: function() {
canjs inserted events function is not called, when i try to call it dynamically
also i am linking the canjs libraries via npm link
Chasen Le Hara
@chasenlehara
Jan 24 21:27 UTC
How’re you trying to call it?
Piyush Sharma
@Piyush5767
Jan 24 21:27 UTC
by using it tag name : tag: 'keyboard'
Chasen Le Hara
@chasenlehara
Jan 24 21:28 UTC
Would you mind putting a small example together in a JS Bin (or something like it)? https://jsbin.com/venaje/4/edit?html,js,output
Piyush Sharma
@Piyush5767
Jan 24 21:28 UTC
and then in stache i am using the full tag to call that component and pass attributes
sure
Piyush Sharma
@Piyush5767
Jan 24 21:35 UTC
basically i m trying to call other component by using its tag name dynamically
<div class="modal fade cabinetEditSlot" id="cabinet{{cabinet.cabinet_id}}EditSlot" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static" data-keyboard="false">
  <div class="modal-dialog" role="document">
      <div class="modal-content">
          <div class="modal-body">
          <!-- Main Modal Data : Starts -->
          <div class="main-container">
            <keyboard type="textarea" layout="alpha" placeholder="Enter product name" append-locally="false" use-preview="true"></keyboard>                          
          </div><!--/ main-container -->
          <!-- Main Modal Data : Ends -->
        </div>
      </div><!--/ modal-content -->
    </div><!--/ modal-dialog -->
</div><!--/ #catalogProduct.modal -->
@chasenlehara if you see in model i am calling keyboard canjs viewmodel where as i am unable to make a call
Chasen Le Hara
@chasenlehara
Jan 24 22:42 UTC
@Piyush5767 I think component names have to be hyphenated, so something like app-keyboard
I’m not sure if that would cause the issue, but I’d start there