Question

Why the ng-repeat does not work declaring my model with Object.create.

In the example bellow i am declaring two models. But when i try to declare the second one with Object.create does not work the iteration:

$scope.model1 = model;                //Work
$scope.model2 = Object.create(model); //Not working

Here the example: http://jsfiddle.net/U3pVM/3795/

Était-ce utile?

La solution

because you are using Object wrong, change your code to this,

$scope.model2 = Object(model);

but if you want clone/copy your object use angular.copy here is a link to DOCUMENTATION...

$scope.model2 = angular.copy(model);
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top