我想點擊一個與angularjs的鏈接,但它沒有響應點擊單擊事件。點擊錨鏈接時什麼也沒有發生。這是angularjs腳本標籤點擊一個鏈接與angularjs沒有響應點擊
<script data-require="[email protected]" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.js"></script>
<script type="text/javascript">
angular.module("module",[])
.controller("controller",function($scope){
$scope.func =function(){
alert('clicked me');
}
})</script>
我申請的點擊這樣的片段,但沒有響應點擊事件
<div ng-app="module" ng-controller="controller" class="separator clear-left">
<p class="btn-add">
<i class="fa fa-shopping-cart"></i>
<a href="#" id="click" class="hidden-sm add" id-data="1">Add to cart</a>
<br>
<a ng-click="func()" href="#">Take me there</a> <!-- area of problem -->
</p>
<p class="btn-details">
<i class="fa fa-list"></i><a href="#" class="hidden-sm detail">More details</a>
</p>
</div>
爲什麼單擊事件中使用angularjs
嘗試的console.log。如果console.log顯示值,請檢查窗口上的警報是否被阻止。 @parker –
可能是你的CSS覆蓋。檢查你的按鈕css。 –