Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can.List's static Map property is not respected ~13 #4

Open
justinbmeyer opened this issue May 22, 2016 · 2 comments
Open

can.List's static Map property is not respected ~13 #4

justinbmeyer opened this issue May 22, 2016 · 2 comments

Comments

@justinbmeyer
Copy link
Contributor

justinbmeyer commented May 22, 2016

From:

If I define a List with a custom Map type and add a plain can.Map instance to it, the resulting Obervable in the List remains a can.Map (not an instance of the the custom Map Type).

Here's an example:

var MyMap = can.Map.extend({});

var MyList = can.List.extend({
  Map: MyMap
}, {});

var map = new MyList([new can.Map({})]);
map.push(new can.Map({}));
map.push({});

console.log(map[0] instanceof MyMap);
console.log(map[1] instanceof MyMap);
console.log(map[2] instanceof MyMap);

Working fiddle of the same: http://jsbin.com/wukuduruho/edit?html,js,output

The problem is this condition in can.Map

@justinbmeyer justinbmeyer changed the title Passing can.Map to can.List with a static Map property does not convert properly - P(1) ~8 can.List's static Map property is not respected - P(1) ~8 May 22, 2016
@justinbmeyer justinbmeyer changed the title can.List's static Map property is not respected - P(1) ~8 can.List's static Map property is not respected - P(1) ~13 May 22, 2016
@pYr0x
Copy link

pYr0x commented May 23, 2016

@justinbmeyer confirming. that is the issue i had

@justinbmeyer justinbmeyer added the p2 label Sep 1, 2016
@justinbmeyer justinbmeyer changed the title can.List's static Map property is not respected - P(1) ~13 can.List's static Map property is not respected ~13 Sep 1, 2016
@justinbmeyer
Copy link
Contributor Author

we should check this with define-map too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants