[Solved] script not working properly [closed]


there are several issues in this code. first the closing of the controller brackets should be changed

app.controller("notePadCtrl",function($scope){
    $scope.message="";
    $scope.left=function(){
        return 100 - $scope.message.lenght;
    };
    $scope.clear=function(){
        $scope.message="";
    };
    $scope.save=function(){
        alert("file got saved");
    };
});

then add the angular script tag inside the body or head tag

<!DOCTYPE html>
<html>

  <head>
    <script data-require="[email protected]" data-semver="1.5.8" src="https://code.angularjs.org/1.5.8/angular.js"></script>
    <link rel="stylesheet" href="style.css" />
    <script src="script.js"></script>
  </head>

  <body ng-app="notePad" ng-controller="notePadCtrl">
    <textarea ng-model="message"></textarea>
    <button ng-click="save()">save</button>
    <button ng-click="clear()">clear</button>
  </body>

</html>

check out the pluker

5

solved script not working properly [closed]