Last active
July 10, 2017 19:25
-
-
Save Danyboy/ca9f27905d9f898937ed26653fc797aa to your computer and use it in GitHub Desktop.
Revisions
-
Danyboy revised this gist
Jul 10, 2017 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,12 +18,12 @@ <h1>{{myWelcome}}</h1> app.controller('myCtrl', function($scope, $http) { $http.get("https://api.github.com/repos/angular/angular/issues") .then(function(response) { $scope.myWelcome = []; angular.forEach(response.data, function(value, key) { if (value && value.labels[0] && value.labels[0].color){ this.push(key + ': ' + value.labels[0].color); } }, $scope.myWelcome); }); }); </script> -
Danyboy created this gist
Jul 10, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ <!DOCTYPE html> <html> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script> <body> <div ng-app="myApp" ng-controller="myCtrl"> <p>Today's welcome message is:</p> <h1>{{myWelcome}}</h1> </div> <p>The $http service requests a page on the server, and the response is set as the value of the "myWelcome" variable.</p> <script> var app = angular.module('myApp', []); app.controller('myCtrl', function($scope, $http) { $http.get("https://api.github.com/repos/angular/angular/issues") .then(function(response) { $scope.myWelcome = []; angular.forEach(response.data, function(value, key) { if (value && value.labels[0] && value.labels[0].color){ this.push(key + ': ' + value.labels[0].color); } }, $scope.myWelcome); }); }); </script> </body> </html>