<div id="clickId" ng-app="myApp" ng-controller="firstCtrl">
<a ng-if="show" onclick="hideHtml()">click</a>
</div>
<script src="http://cdn.bootcss.com/angular.js/1.5.6/angular.min.js"></script>
<script>
angular.module('myApp', []).controller('firstCtrl', function ($scope, $timeout) {
$timeout(function () {
$scope.show = true
})
$scope.hideHtml = function () {
alert(arguments[0])
}
})
function hideHtml() {
angular.element(document.getElementById('clickId')).scope().hideHtml('123')
}
</script>
转载于:https://my.oschina.net/zhangyafei/blog/908303