These are chat archives for canjs/canjs

20th
Dec 2018
Mohamed Cherif Bouchelaghem
@cherifGsoul
Dec 20 2018 09:38
@the-learning-man thank you for reporting this , I added uglifyjs-webpack-plugin to devDependencies, is working now!
Justin Meyer
@justinbmeyer
Dec 20 2018 15:01
Thanks @the-learning-man !
the-learning-man
@the-learning-man
Dec 20 2018 16:55
Thanks @cherifGsoul and @justinbmeyer
the-learning-man
@the-learning-man
Dec 20 2018 19:01
Hi All
Need assistance for the following [dynamically loading stache files ]

Was trying to set up a prototype using the script tag setup,

<script src="./node_modules/can/dist/global/core.js"></script>
and it works well, but could not get it to load the stache template dynamically.
e.g. const template = can.stache("./cart/list-item.stache", {});
can.stache input takes a.filename, b. template

Any pointer would be appreciated.

have attached a barebones package.json index.html and index.stache to the zip for ref.
Justin Meyer
@justinbmeyer
Dec 20 2018 19:19
@the-learning-man will be able to help you in a bit
which version of CanJS are you using?
b/c that form of canjs is very old, and not supported
can.stache("./cart/list-item.stache", {}) should be more like
can.stache("./cart/list-item.stache", `{{foo}}`)
the filename is just used for debugging ... it doesn't actually load a file
apsignifi
@apsignifi
Dec 20 2018 20:37

can3
are there any pre-requisites for this to work :

<input type="checkbox" class="toggle" checked="checked" el:checked:bind="kioskDimension" />

Justin Meyer
@justinbmeyer
Dec 20 2018 21:09
can-stache-bindings needs to be imported @apsignifi
the-learning-man
@the-learning-man
Dec 20 2018 23:06
@justinbmeyer thanks, its the latest version of can, the zip-file can5legacy.zip has a package.json and usage, "dependencies": {
"can": "^5.20.0",
"steal-stache": "^4.1.2"
},
any way I can quickly use the filename instead of the inline string to load the template?