Skip to content

Instantly share code, notes, and snippets.

@marioflores
Created November 7, 2013 12:48
Show Gist options
  • Save marioflores/7354064 to your computer and use it in GitHub Desktop.
Save marioflores/7354064 to your computer and use it in GitHub Desktop.
Simple Angular Drop Down
<!DOCTYPE html>
<html ng-app="">
<head>
<title>Banner Onclick Code</title>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.js"></script>
<script>
function bannerCode($scope) {
$scope.programs=[
{name:'Appellate'},
{name:'Bankruptcy'},
{name:'District'},
{name:'Pretrial/Probation'},
{name:'Technical'},
{name:'Other'}
]
}
</script>
</head>
<body>
<div ng-controller="bannerCode">
<p>Name:</p>
<select ng-model="prog" ng-options="p.name for p in programs">
</select>
<p>Item Name:</p>
<input type="text" data-ng-model="itemName" /> {{ name }}
<p>Code:</p>
<div ng-show="prog">{{ "Banner/" + prog.name + "/" + itemName}}</div>
<div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment