<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<style>
body {
font-family: 'Roboto', sans-serif;
}
</style>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.min.js"></script>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.selecOptions = [{
name: 'No',
value: true
}, {
name: 'Yes',
value: false
}];
$scope.textInput = {
disabled: $scope.selecOptions[0].value
};
});
</script>
</head>
<body ng-app="myApp">
<div ng-controller="myCtrl">
<h2>ngDisabled Example</h2>
<label> Opt in? </label>
<select ng-model="textInput.disabled"
ng-options='option.value as option.name for option in selecOptions'>
</select>
<br/>
<br/>
<input type="text"
ng-disabled="textInput.disabled" />
<p>{{ form.disabled }}</p>
</div>
</body>
</html>
// Code goes here
/* Styles go here */