AngularJS : ng-click not working

后端 未结 5 761
长发绾君心
长发绾君心 2020-12-17 07:54

I am new in AngularJs, ng-click is not working as expected. I searched on the internet , Follow the tutorial , (that was working) - but this is not working!!!

My Cod

5条回答
  •  清歌不尽
    2020-12-17 08:06

    Have a look at this plunker

    HTML:

    
    
    
      
        
        
        
      
    
      
        
    {{data.fname}}

    {{data.fname}}

    Javascript:

    var app = angular.module('app', []);
    //Follows Controller
    app.controller('FollowsController', function($scope, $http) {
        var ukey = window.localStorage.ukey;
        //alert(dataFromServer);
        $scope.showDetail = function(index) {
            profileusertoken =  index;
            $scope.ons.navigator.pushPage('profile.html'); 
        }
    
        function showDetail2(index) {
            alert("here");
        }
    
        $scope.showDetail2 = showDetail2;
        $scope.myform ={};
        $scope.myform.reports ="";
        $http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded";
        var dataObject = "usertoken="+ukey;
        //var responsePromise = $http.post("follows/", dataObject,{});
        //responsePromise.success(function(dataFromServer, status,    headers, config) {
    
        $scope.myform.all_followers = [[{fname: "blah"}, {fname: "blah"}, {fname: "blah"}, {fname: "blah"}]];
    });
    

提交回复
热议问题