Last active
August 29, 2015 14:15
-
-
Save Usse/c7fd43861d74c15ab86d to your computer and use it in GitHub Desktop.
Revisions
-
Usse revised this gist
Feb 19, 2015 . 1 changed file with 1 addition and 0 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 @@ -24,6 +24,7 @@ }; app.controller('MainController',MainController); //app.controller('MainController',['$scope', '$http', MainController]); <-- minifier friendly version }()); </script> -
Usse revised this gist
Feb 19, 2015 . 1 changed file with 37 additions and 0 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 @@ -0,0 +1,37 @@ <!DOCTYPE html> <html ng-app="app"> <head> <script data-require="[email protected]" data-semver="1.4.0-beta.4" src="https://code.angularjs.org/1.4.0-beta.4/angular.js"></script> <link href="style.css" rel="stylesheet" /> <script> (function() { var app = angular.module('app', []); var MainController = function($scope, $http) { var onUserComplete = function(response) { $scope.user = response.data; }; var onError = function(response) { $scope.error = "Could not fetch the user."; } $http.get('https://api.github.com/users/usse') .then(onUserComplete, onError); }; app.controller('MainController',MainController); }()); </script> </head> <body ng-controller="MainController"> <div>{{error}}</div> <h1>{{user.name}}</h1> <img ng-src="{{user.avatar_url}}" title="{{user.name}}" width="200"> </body> </html> -
Usse revised this gist
Feb 19, 2015 . 1 changed file with 32 additions and 0 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 @@ -0,0 +1,32 @@ <!DOCTYPE html> <html ng-app="app"> <head> <script data-require="[email protected]" data-semver="1.4.0-beta.4" src="https://code.angularjs.org/1.4.0-beta.4/angular.js"></script> <link href="style.css" rel="stylesheet" /> <script> angular.module('app', []). controller('MainController', ['$scope', '$http', function($scope, $http) { var onUserComplete = function(response) { $scope.user = response.data; }; var onError = function(response) { $scope.error = "Could not fetch the user."; } $http.get('https://api.github.com/users/usse') .then(onUserComplete, onError); }]); </script> </head> <body ng-controller="MainController"> <div>{{error}}</div> <h1>{{user.name}}</h1> <img ng-src="{{user.avatar_url}}" title="{{user.name}}" width="200"> </body> </html> -
Usse revised this gist
Feb 19, 2015 . 1 changed file with 0 additions and 4 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 @@ -4,18 +4,14 @@ <head> <script data-require="[email protected]" data-semver="1.4.0-beta.4" src="https://code.angularjs.org/1.4.0-beta.4/angular.js"></script> <link href="style.css" rel="stylesheet" /> <script> angular.module('app', []). controller('MainController', ['$scope', function($scope) { var person = { firstname : 'Andrea', lastname : 'Usseglio', imgSrc : 'https://pbs.twimg.com/profile_images/1599369214/312a6f2_200x200.jpg' } $scope.person = person; }]); </script> -
Usse created this gist
Feb 19, 2015 .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,28 @@ <!DOCTYPE html> <html ng-app="app"> <head> <script data-require="[email protected]" data-semver="1.4.0-beta.4" src="https://code.angularjs.org/1.4.0-beta.4/angular.js"></script> <link href="style.css" rel="stylesheet" /> <!-- <script src="script.js"></script> --> <script> angular.module('app', []). controller('MainController', ['$scope', function($scope) { var person = { firstname : 'Andrea', lastname : 'Usseglio', imgSrc : 'https://pbs.twimg.com/profile_images/1599369214/312a6f2_200x200.jpg' } $scope.person = person; }]); </script> </head> <body ng-controller="MainController"> <h1>{{person.firstname + " " + person.lastname}}</h1> <img ng-src="{{person.imgSrc}}" title="{{person.firstname}} {{person.lastname}}"> </body> </html>