a - Anchor Tag Directive
home
Run
screen_rotation
fullscreen
cloud_download
<!DOCTYPE html> <html lang="en"> <head> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.min.js"></script> <script> var myApp = angular.module("myApp", []); myApp.controller("myController", function($scope) { $scope.result = ''; $scope.testFn = function() { $scope.result = 'You Clicked Me!'; } }); function myFn(){ alert("Called From Outside"); } </script> </head> <body> <div ng-app="myApp"> <div ng-controller="myController"> <h3>Inside AngularJs App</h3> <a href="" ng-click ="testFn()" >Test Function</a> <br> Result = {{result}} </div> </div> <h3>Outside AngularJs App</h3> <a href="" onclick ="myFn()" >My Function</a> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.min.js"></script> <script> var myApp = angular.module("myApp", []); myApp.controller("myController", function($scope) { $scope.result = ''; $scope.testFn = function() { $scope.result = 'You Clicked Me!'; } }); function myFn(){ alert("Called From Outside"); } </script> </head> <body> <div ng-app="myApp"> <div ng-controller="myController"> <h3>Inside AngularJs App</h3> <a href="" ng-click ="testFn()" >Test Function</a> <br> Result = {{result}} </div> </div> <h3>Outside AngularJs App</h3> <a href="" onclick ="myFn()" >My Function</a> </body> </html>
Copyrights@tutorialsplane.com