Skip to content

component.constructor.ViewModel is undefined when "viewModel" is function (v3.3.10) #332

@YuriChupyrkin

Description

@YuriChupyrkin

Hello canJS team.

I migrate the APP from canJs 2 to canJs 3 and have issue connected to can-component package.

I use can-component v3.3.10
When I use viewModel as function, I have exception in that line:

viewModelInstance = new component.constructor.ViewModel(initialViewModelData);

It happens because component.constructor.ViewModel is undefined.

Looks like that issue is fixed in v4.5.0:

viewModelInstance = new ViewModel(initialViewModelData);

Could you fix it for can-component v3.x.x?

Screen Shot 2019-03-27 at 11 53 17

@justinbmeyer please take a look

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions