Java, .NET, PHP, PYTHON, ANGULAR, .NET, ML, Data Scince, Testing, CI Tutorials in Easy Languages.

"Best Software Training, Internship, Project Development center of Indore India, Helpline 780506-3968"


<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript" src="angular.min.js"></script>
</head>
<body>
  <div ng-app="myapp" ng-controller="myctrl">

    <select ng-model="$parent.course" multiple="true">
      <option ng-repeat="item in arr" value="{{item}}" >{{item}} </option>

    </select>
    <input type="button" value="Click" ng-click="fun()" />
<br><br>
    {{msg}}
  </div>

  <script type="text/javascript">
 
   var app = angular.module('myapp',[]);
   app.controller('myctrl',function($scope)
   {

      $scope.arr = ["C","CPP","DS","JAVA","PHP","iOS","Android"];
      $scope.fun=function()
      {
        if ($scope.course!=undefined)
          $scope.msg = $scope.course;
         else
          $scope.msg = 'Please choose an option';
      }
   }

    )

  </script>
</body>
</html>

Post a Comment

If you have any doubt in programming or join online classes then you can contact us by comment .

Previous Post Next Post