不墨迹直接上代码
html代码
<ul ng-click="logout();">
</ul>
js代码
return {
restrict: 'A',
replace: true,
templateUrl: 'view/template/angHead.html',
link: function ($scope) {
$scope.logout = function () {
console.log(1)
}
}
};