0

i'm using angular js in my website and i'm getting a strange behavior when i update my model.

My model is an json complex object like this:

$scope.DataSource = {prop1:"", prop2:[{a:1, b:b2}, {a:3, b:4}], prop3:"value"}

use a controller to edit object an use custom directives to edit separatelly child objects like in prop2 ( in this case are tabs ).

My problem is that when i update $scope.DataSource the previous generated DOM elements are not removed or updated, i just get a duplicated UI for each object in Prop2.

is there any way to force angular to update or remove previous generated elements? preventing a duplicated tabs(in this case)?

4

1 回答 1

0

重复的 DOM 元素可能是与视图关联的范围内重复数据的结果。如果没有任何代码,则不清楚生成视图的范围是绑定到控制器还是指令。尝试将生成视图的范围记录到控制台。

于 2013-01-23T04:54:35.353 回答