divya
divya

Reputation: 261

how to call javascript function after loading angularjs element

i need to call java script function aftter loading div please help me to call javascript function after loading angularjs element

 <div id="teset" ng-load="getAngularValue()">venn {{test}}</div>


function getAngularValue(){
alert("getAngularValue");

}
</script>

Upvotes: 1

Views: 2797

Answers (2)

Ankit Pundhir
Ankit Pundhir

Reputation: 1097

Why you want call javascript function inside angularjs?

Upto my knowledge you can do a lot of work inside angularjs controller.

<div id="teset" ng-init="getAngularValue()">venn {{test}}</div>

<script>
    angular.module('demoApp').controller('demoCtrl',function($scope){
        $scope.getAngularValue = function(){
              //todo logic
              alert("getAngularValue");
        };
    });
<script>

Upvotes: 1

Piotr Bujok
Piotr Bujok

Reputation: 103

To use ng-load, your function must be placed in Angualr controller

This link schould help you:

Upvotes: 0

Related Questions