I have un little problem with DOM manipulation.

Here's my angular function:

$scope.modif = function (e) {
        $scope.temp = 
e.target.offsetParent.offsetParent.childNodes[3].childNodes[(this.$index+1)*2];
        $scope.temp.childNodes[11].innerHTML = $compile('<button 
ng-click="save($event)">Save</button>')($scope);};

but my button is rendered like that in the document:

[[object HTMLButtonElement]

I know that using innerHTML with Angular is wrong but when i'm using 
.html() i have this error:

$scope.modif = function (e) {
        $scope.temp = 
e.target.offsetParent.offsetParent.childNodes[3].childNodes[(this.$index+1)*2];
        $scope.temp.childNodes[11].html($compile('<button 
ng-click="save($event)">Save</button>')($scope));};

TypeError: undefined is not a function at h.$scope.modif

Thanks, 

François

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to