Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

angularjs Uncaught ReferenceError: myFunction is not defined at HTMLInputElement.onkeyup

angular.module('myApp', [])
  .controller('myCtrl', ['$scope', '$http', function($scope, $http) {
    $scope.fname = "";
    $scope.myFunction = function() {
      console.log($scope.fname)
    }
  }]);
.ucase {
  text-transform: uppercase;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.5/angular.min.js"></script>
<div ng-app="myApp" ng-controller="myCtrl">
  <nb-card>
    <nb-card-header>
      Enter your name:
    </nb-card-header>
    <nb-card-body>
      <input type="text" ng-model="fname" class='ucase' ng-keyup="myFunction()">
    </nb-card-body>
  </nb-card>
</div>
 
PREVIOUS NEXT
Tagged: #angularjs #Uncaught #myFunction #defined
ADD COMMENT
Topic
Name
6+2 =