These are chat archives for canjs/canjs

17th
Mar 2016
Christopher Oliphant
@RALifeCoach
Mar 17 2016 00:09
I am stuck
Thomas Sieverding
@Bajix
Mar 17 2016 00:09
Do tell
Christopher Oliphant
@RALifeCoach
Mar 17 2016 00:10
var t = [_super_class].concat(can.makeArray(arguments)), args = Constructor.setup.apply(Constructo
.setup is undefined
that is burried somewhere in the canjs code
i think since adding _super plugin
I had this working at one stage
This message was deleted
ns.CanBase = can.Construct.extend({});
so I tried adding ns.CanBase = can.Construct.extend({
setup: function () {
this._super();
}
});
but that didn’t work either
Thomas Sieverding
@Bajix
Mar 17 2016 00:13
Wrap code with:
```js
... the code
```
Christopher Oliphant
@RALifeCoach
Mar 17 2016 00:14
ns.CanBase = can.Construct.extend({
        setup: function () {
            this._super();
        }
    });
Thomas Sieverding
@Bajix
Mar 17 2016 00:15
super -> init
Christopher Oliphant
@RALifeCoach
Mar 17 2016 00:15
The can js code is:
            Constructor.prototype.constructor = Constructor;
            var t = [_super_class].concat(can.makeArray(arguments)), args = Constructor.setup.apply(Constructor, t);
            if (Constructor.init) {
                Constructor.init.apply(Constructor, args || t);
            }
            return Constructor;
Thomas Sieverding
@Bajix
Mar 17 2016 00:16
You can’t use that in setup
Christopher Oliphant
@RALifeCoach
Mar 17 2016 00:17
I renamed to init and I am still getting the problem
This message was deleted
Uncaught TypeError: Cannot read property 'apply' of undefinedcan.extend.extend @ can.custom.js:2681(anonymous function) @ can.custom.js:2943global.define @ can.custom.js:60(anonymous function) @ can.custom.js:2933
can.custom.js:2681 Uncaught TypeError: Cannot read property 'apply' of undefinedcan.extend.extend @ can.custom.js:2681(anonymous function) @ ns.canBase.js:647(anonymous function) @ ns.canBase.js:671
Thomas Sieverding
@Bajix
Mar 17 2016 00:18
You rename what to init?
I never said to rename anything to init
Christopher Oliphant
@RALifeCoach
Mar 17 2016 00:18
setup to init - but I don’t even need the _super call
Thomas Sieverding
@Bajix
Mar 17 2016 00:18
;o
init never changed
What version of CanJS was this built with?
Christopher Oliphant
@RALifeCoach
Mar 17 2016 00:19
it is stll crashing without _super
Thomas Sieverding
@Bajix
Mar 17 2016 00:20
Version pl0x
Christopher Oliphant
@RALifeCoach
Mar 17 2016 00:20
?
Thomas Sieverding
@Bajix
Mar 17 2016 00:20
This whole constructor/setup/init business seems fishy
What is can.VERSION
Christopher Oliphant
@RALifeCoach
Mar 17 2016 00:21
2.3.20
Thomas Sieverding
@Bajix
Mar 17 2016 00:21
What was it previously?
Mohamed Cherif Bouchelaghem
@cherifGsoul
Mar 17 2016 00:21
@RALifeCoach is the super plugin for can.Construct included?
Christopher Oliphant
@RALifeCoach
Mar 17 2016 00:21
it hasn’t changed
and yes the super plugin is included
Mohamed Cherif Bouchelaghem
@cherifGsoul
Mar 17 2016 00:22
can you make a jsbin?
Christopher Oliphant
@RALifeCoach
Mar 17 2016 00:22
what is a jsbiin?
Mohamed Cherif Bouchelaghem
@cherifGsoul
Mar 17 2016 00:23
clone this
put the code that makes the problem
and it can be solved
Thomas Sieverding
@Bajix
Mar 17 2016 00:23
@RALifeCoach Did you rename any functions? If so, which
Christopher Oliphant
@RALifeCoach
Mar 17 2016 00:25
no - in my original version it was just:
    ns.CanBase = can.Construct.extend({});
Christopher Oliphant
@RALifeCoach
Mar 17 2016 00:30
I ran with super plugin on jsbin and it works
Mohamed Cherif Bouchelaghem
@cherifGsoul
Mar 17 2016 00:30
Emm
Christopher Oliphant
@RALifeCoach
Mar 17 2016 00:31
what do I include to include the plugin?
what is the name of the js file?
Thomas Sieverding
@Bajix
Mar 17 2016 00:31
Create a custom build that includes it
Mohamed Cherif Bouchelaghem
@cherifGsoul
Mar 17 2016 00:32
1 sec I check
Thomas Sieverding
@Bajix
Mar 17 2016 00:32
Otherwise, man up and use DI ;p
Christopher Oliphant
@RALifeCoach
Mar 17 2016 00:32
that’s what I did. but that won’t work on jsbin
I use a custom build in my own code
Mohamed Cherif Bouchelaghem
@cherifGsoul
Mar 17 2016 00:32
can.construct.super.js
what do you use? steal?
Thomas Sieverding
@Bajix
Mar 17 2016 00:33
It’s old school, he’s not using DI
Christopher Oliphant
@RALifeCoach
Mar 17 2016 00:33
okay it’s working in jsbin
Mohamed Cherif Bouchelaghem
@cherifGsoul
Mar 17 2016 00:35
@RALifeCoach solved?
Christopher Oliphant
@RALifeCoach
Mar 17 2016 00:36
I stopped using the custom build
and that got me over the first hump
Mohamed Cherif Bouchelaghem
@cherifGsoul
Mar 17 2016 00:37
ok
I dont know you did a custom build
Christopher Oliphant
@RALifeCoach
Mar 17 2016 01:09
what gets called when the DOM is initialized
Thomas Sieverding
@Bajix
Mar 17 2016 01:09
inserted
Christopher Oliphant
@RALifeCoach
Mar 17 2016 01:09
thanks
Christopher Oliphant
@RALifeCoach
Mar 17 2016 01:59
anyone still online?
Thomas Sieverding
@Bajix
Mar 17 2016 01:59
yup
Christopher Oliphant
@RALifeCoach
Mar 17 2016 02:00
I have a module that defines both instantiated and static methods
Thomas Sieverding
@Bajix
Mar 17 2016 02:00
And?
Christopher Oliphant
@RALifeCoach
Mar 17 2016 02:01
can.Constructor({….}, { setupXX: function () {}});
Thomas Sieverding
@Bajix
Mar 17 2016 02:01
Wrap code with:
```js
... the code
```
Christopher Oliphant
@RALifeCoach
Mar 17 2016 02:02
can.Constructor({….}, { setupXX: function () {}});
when I try and call Module.setupXX I get the message Module.setupXX is not a function
setup is:
Thomas Sieverding
@Bajix
Mar 17 2016 02:04
That’s because you’ve defined a function prototype above
Christopher Oliphant
@RALifeCoach
Mar 17 2016 02:04
sorry, I don’t understand what you mean
Thomas Sieverding
@Bajix
Mar 17 2016 02:05
Syntax is static props, prototype props
You defined Module.prototype.setupXX above
Christopher Oliphant
@RALifeCoach
Mar 17 2016 02:06
so I have to reverse them
Thomas Sieverding
@Bajix
Mar 17 2016 02:06
Yes
Christopher Oliphant
@RALifeCoach
Mar 17 2016 02:08
okay - all my errors are gone - it’s not working, but all my console errors are gone
thanks for your help
I am off to bed
Thomas Sieverding
@Bajix
Mar 17 2016 02:09
night
Christopher Oliphant
@RALifeCoach
Mar 17 2016 14:41
I’m back - with what I hope is a simple question.
I create a component - everything works fine
I create a second compnent and I get
Uncaught TypeError: Cannot read property 'add' of undefinedmixins.add @ can.custom.js:3791parser.chars @ can.custom.js:9473callChars @ can.custom.js:4120HTMLParser @ can.custom.js:4145stache @ can.custom.js:9364can.view.register.fragRenderer @ can.custom.js:9551can.extend.registerView @ can.custom.js:1284getRenderer @ can.custom.js:1081(anonymous function) @ can.custom.js:2054can.extend.renderAs @ can.custom.js:1262can.view.can.template @ can.custom.js:1121global.pgatour.components.PhotoComponent.global.pgatour.components.PhotoComponent.can.Construct.extend.init @ photo-component.js:25can.extend.newInstance @ can.custom.js:2603init @ can.custom.js:2653Constructor @ can.custom.js:2648global.pgatour.Tournament2ShotTracker.global.pgatour.Tournament2ShotTracker.global.pgatour.CanBaseLazyLoadModule.extend.initProperties @ pgatour.tournament-2-shot-tracker.js:146global.pgatour.Tournament2ShotTracker.global.pgatour.Tournament2ShotTracker.global.pgatour.CanBaseLazyLoadModule.extend.renderData @ pgatour.tournament-2-shot-tracker.js:112global.pgatour.Tournament2ShotTracker.global.pgatour.Tournament2ShotTracker.global.pgatour.CanBaseLazyLoadModule.extend.onGetData @ pgatour.tournament-2-shot-tracker.js:552class_cb @ can.custom.js:9635c @ jquery-1.10.2.min.js:4p.fireWith @ jquery-1.10.2.min.js:4k @ jquery-1.10.2.min.js:6r @ jquery-1.10.2.min.js:6
Christopher Oliphant
@RALifeCoach
Mar 17 2016 14:58
Please ignore my prior comments
Matthew Phillips
@matthewp
Mar 17 2016 14:59
What was it?
We need to give you a better error message than that.
Christopher Oliphant
@RALifeCoach
Mar 17 2016 15:00
There was an error in the template - I hadn’t yet converted from handlebars to stache
Viktor Busko
@Lighttree
Mar 17 2016 15:06
Is there any way or hooks that can help me with animating route changes (between steps) ?
Julian
@pYr0x
Mar 17 2016 15:14
css?
Viktor Busko
@Lighttree
Mar 17 2016 19:46
@pYr0x thank you. Can-animate is something that I was looking for