Search
 
SCRIPT & CODE EXAMPLE
 

HTML

angularjs call js function

<!--HTML-->
<div id="YourElementId" ng-app='MyModule' ng-controller="MyController">
    Hi
</div>

<script>
//JS Code
angular.module('MyModule', [])
    .controller('MyController', function ($scope) {
    $scope.myfunction = function (data) {
        alert("---" + data);
    };
});

window.onload = function () {
    angular.element(document.getElementById('YourElementId')).scope().myfunction('test');
}
</script>
Comment

call js function in Angular 12

eval(evaluation: string) {
     return eval(evaluation)
}

<div *ngFor="...">
  <div *ngIf="eval('...')"></div>
</div>
 Run code snippet
Comment

PREVIOUS NEXT
Code Example
Html :: html year picker 
Html :: status code 201 
Html :: print html table 
Html :: random number text in html 
Html :: boostrap navbar 
Html :: remove active class from all li javascript 
Html :: html cheetsheet.com 
Html :: bulma hero 
Html :: how to show data in html table from database in multiple table in laravel 
Html :: data table in html code 
Html :: learn how to build a website code 
Html :: convert figma to html 
Html :: openGraph 4 
Html :: html temple 
Html :: tina4 form token example 
Html :: Impossible to create the root directory "/var/www/html/laraship-subscription/storage/app/public/media/user_v1oz1Yz27j/26 
Html :: Testing the dom api 
Html :: jqery each from string html 
Html :: half-star icon 
Html :: html language 
Html :: nuxt print html 
Html :: how to make comments in markdown which do not render in html 
Html :: icon-test 
Html :: erc20 symbol format 
Html :: what is 2 + 2 
Html :: Reveal css animations 
Html :: html pretty print 
Html :: how to disable movable textarea in html 
Html :: show html in laravel template 
Html :: file download button html 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =