JSFiddle - React, Tailwind, and code Playground
by javiros
HTML
<div ng-app="myApp" ng-controller="regionsCtrl">
<div class="form-group">
<div class="col-lg-offset-2 col-lg-10">
<select ng-model="selectedName" ng-options="name.name for name in data.badges">
</select>
<br />
{{selectedName}}
</div>
</div>
</div>
JavaScript
var app = angular.module('myApp', []);
app.controller('regionsCtrl', function($scope, $http) {
$scope.rec = {
isSpecial: 1
}
$scope.data = {
"name": "Aydın Çağrı Dumlu",
"profile_name": "acgrdumlu",
"profile_url": "https://teamtreehouse.com/acgrdumlu",
"gravatar_url": "https://secure.gravatar.com/avatar/03fe5c9e7504e1715bb3f32914d06cda?s=400\u0026d=https%3A%2F%2Fstatic.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-ea7cf6abde4eec089a4e03cc925d0e893e428b2b6971b12405a9b118c837eaa2.png\u0026r=pg",
"gravatar_hash": "03fe5c9e7504e1715bb3f32914d06cda",
"badges": [{
"id": 49,
"name": "Newbie",
"url": "https://teamtreehouse.com/acgrdumlu",
"icon_url": "https://achievement-images.teamtreehouse.com/Generic_Newbie.png",
"earned_date": "2017-06-14T06:59:03.000Z",
"courses": []
}, {
"id": 2122,
"name": "Introducing JavaScript",
"url": "https://teamtreehouse.com/library/javascript-basics/introducing-javascript",
"icon_url": "https://achievement-images.teamtreehouse.com/badges_JavaScript_Basics_Stage1.png",
"earned_date": "2017-06-14T10:34:15.000Z",
"courses": [{
"title": "JavaScript Basics",
"url": "https://teamtreehouse.com/library/javascript-basics",
"badge_count": 1
}, {
"title": "Introducing JavaScript",
"url": "https://teamtreehouse.com/library/javascript-basics/introducing-javascript",
"badge_count": 1
}]
}, {
"id": 2132,
"name": "JavaScript Variables",
"url": "https://teamtreehouse.com/library/javascript-basics/storing-and-tracking-information-with-variables",
"icon_url": "https://achievement-images.teamtreehouse.com/badges_JavaScript_Basics_Stage2.png",
"earned_date": "2017-06-14T14:07:35.000Z",
"courses": [{
"title": "JavaScript Basics",
"url": "https://teamtreehouse.com/library/javascript-basics",
"badge_count": 1
}, {
...