문제

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/

도움이 되었습니까?

해결책

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);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top