简体   繁体   中英

Angular - ng-click not working

I am trying to implement AngularJs in my E-Commerce application. I want to know which version should I use and embed in my project. Below is one error I got when I tried to implement ng-click .

Did anybody face the same issue?

var eventModule = angular.module("eventModule", []);

eventModule.controller("eventController", function ($scope) {
    $scope.update = function () {
        alert('Update called');
    }
});

Html is:

<html ng-app="eventModule">
   <div class="row ng-scope" ng-controller="eventController">
      <input type="button" value="Update Data" ng-click="update()">
   </div>
</html> 

It's throwing a strange error:

Needed to change order of js references

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>

Previously it was on reverse order.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM