These are chat archives for canjs/canjs

7th
Dec 2016
bkozera
@bkozera
Dec 07 2016 13:27
Hi guys, is there a way to pass attributes to a components loaded using "can-tag" inside "can-import"? I am using canjs 2.3
Arjen Haayman
@haayman_twitter
Dec 07 2016 14:54
I don't get it: the only way I can load modules is by define([source1,source2], function( result1, result2){}) construction. In all examples I see 'import result1 from "source1"; or var result1 = require("source1"); If I try these I get errormessages like 'require' not defined. Or 'module' not defined. How come these constructs all work in the loaded modules, but not in my code? I'm just trying to the basic tutorials
Kevin Phillips
@phillipskevin
Dec 07 2016 14:54
what are you using to load your code?
Arjen Haayman
@haayman_twitter
Dec 07 2016 14:55
steal afaik
Kevin Phillips
@phillipskevin
Dec 07 2016 14:55
steal should support any of those syntaxes
@haayman_twitter I don’t think you can pass data to the component loaded using can-tag
Arjen Haayman
@haayman_twitter
Dec 07 2016 14:56
thats what I thought too. But apparently there are some requisites?
Kevin Phillips
@phillipskevin
Dec 07 2016 14:56
not sure what you mean
Arjen Haayman
@haayman_twitter
Dec 07 2016 14:57
well, is it dependent on something on package.json or other .json files?
Kevin Phillips
@phillipskevin
Dec 07 2016 14:58
no, just steal
setting it up like http://stealjs.com/docs/StealJS.quick-start.html should let you use ES6 or CommonJS syntaxes
there are some docs on each syntax also
maybe it’s the version of steal
you probably need steal > 0.16
Arjen Haayman
@haayman_twitter
Dec 07 2016 15:22
The CommonJS syntax keeps complaining about 'require not defined'. es6 syntax a little better, except when I try this var Something = class {..}; export default Something and then I require Something the result is {default:Something}?
Sérgio Cunha
@sergiomcunha
Dec 07 2016 16:21
Hi
How can I do an update of the state of a var overriding the set() method and trigger other function at the same time?
Kevin Phillips
@phillipskevin
Dec 07 2016 23:53
@sergiomcunha with can.Map and the define plugin you mean?