Skip to content

Instantly share code, notes, and snippets.

@TheSithPadawan
Created May 29, 2018 23:33
Show Gist options
  • Save TheSithPadawan/72f0c5c1b62d4f2ba6b6b72577e757c4 to your computer and use it in GitHub Desktop.
Save TheSithPadawan/72f0c5c1b62d4f2ba6b6b72577e757c4 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
</head>
<body>
<div ng-app="app" ng-controller="MainCtrl" class="list-group">
<div class="list-group-item" ng-repeat="item in messages">
<h4 class="list-group-item-heading">{{ item.question }}</h4>
<p class="list-group-item-text">{{item.options}}</p>
</div>
</div>
<script>
var myApp = angular.module('app',[]);
myApp.controller('MainCtrl',function ($scope, $http){
$http.get('https://raw.githubusercontent.com/corysimmons/colors.json/master/colors.json').then(function(response){
$scope.messages = response.data;
},function (error){
console.log(error, 'cannot get data.');
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment