I know this must be very simple but as a beginner I'am facing this issue. I have tried various solutions provided by others but was unable to solve this problem. How do I pass the value of the variable 'lang' to the controller.
Code:
<body ng-controller = "MyCtrl">
<select ng-model="lang">
<option value="dutch">Dutch</option>
<option value="english">English</option>
</select>
</body>
Controller:
app.controller('MyCtrl',[$scope,function($scope){
console.log($scope.lang);
}]);