Call Angular Function with Jquery

前端 未结 7 1859
遇见更好的自我
遇见更好的自我 2020-12-04 21:59

How to call angular function when data in text box? here is my code

html




        
7条回答
  •  广开言路
    2020-12-04 22:36

    You can put Jquery code into AngularJS controller like

        $scope.shipchange = function (SelectedShipId ) {
            alert('ShipId =' + SelectedShipId );
        }
    
        $("#Ships").change(function () {
    
            SelectedShipId = $("#Ships").val();
            $scope.shipchange(SelectedShipId );
        })
    

提交回复
热议问题