Pergunta

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/

Foi útil?

Solução

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);
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top