angular.js - How to run functions other than Controller in AngularJS?
PHPz
PHPz 2017-05-15 17:00:29
0
1
575

For example, there is an event outside an angular controller

$(document).on('getMediaListDone', function(){
          // do something
        }

Then how to trigger this event in angularjs controller?

PHPz
PHPz

学习是最好的投资!

reply all(1)
phpcn_u1582

angular.element(document).triggerHandler('getMediaListDone')
In older versions of angular, replace triggerHandler with trigger

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template