Skip to content

Instantly share code, notes, and snippets.

View Kalimaha's full-sized avatar
🌒
not because they are easy, but because they are hard

Guido Barbaglia Kalimaha

🌒
not because they are easy, but because they are hard
View GitHub Profile
<h1>
<div class="row">
<div class="col-lg-12 text-center">
<i class="fa fa-spinner fa-pulse fa-5x" ng-hide="genres.length"></i>
</div>
<div ng-repeat="g in genres">
<div class="col-lg-3">
<a href="#genres/{{g.list_name_encoded}}">
<div class="thumbnail">
<div class="caption">
(function () {
'use strict';
var app = angular.module('NYTBestSellers');
app.controller('GenresController', function ($scope, $routeParams, $http) {
var url = 'http://api.nytimes.com/svc/books/v3/lists/names.json?api-key=sample-key';
$http.get(url).then(function (response) {
$scope.genres = response.data.results;
<body>
<body ng-app="NYTBestSellers">
<!-- Header. -->
...
<!-- Main content. -->
<div ng-view></div>
@Kalimaha
Kalimaha / router.js
Created February 5, 2016 08:27
Example of AngularJS router.
(function () {
'use strict';
var app = angular.module('NYTBestSellers', ['ngRoute']);
app.config(function ($routeProvider) {
$routeProvider.when('/genres', {
templateUrl: 'src/html/genres.html',
controller: 'GenresController'
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.js"</script>
<script src = "http://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular-route.js"></script>
<script src="src/js/app.js"</script>
</head>
<body ng-app="NYTBestSellers">
</body>
</html>
(function () {
'use strict';
var app = angular.module('NYTBestSellers', []);
}());
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.js"</script>
<script src="src/js/app.js"</script>
</head>
<body ng-app="NYTBestSellers">
</body>
</html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.js"></script>
</head>
<body ng-app="NYTBookReviews">
</body>
</html>
{
"creationDate":1416268800000,
"language":{
"version":"1998",
"codes":[
{
"code":"ENG",
"label":{
"EN":"English"
}
{
"meDocuments":[
],
"meInstitutionalMandate":{
"legalActsAgreements":"Article I of the constitution indeed requires the Organization to collect, analyse, interpret and disseminate information relating to nutrition, food and agriculture (the term “agriculture” and its derivatives includes forestry, fisheries and aquaculture). The first session of the FAO Conference in 1945 provided the rationale: “If FAO is to carry out its work successfully it will need to know where and why hunger and malnutrition exist, what forms they take, and how widespread they are. Such data will serve as a basis for making plans, determining the efficacy of measures used, and measuring progress from time to time.” Member countries reaffirmed this mandate in 2000 when formulating the Organization’s strategic thrusts for the 2000-2015 period: Corporate Strategy E1 commits the Organization to building “an integrated information resource base, with current, relevant and reliable statistics, information and knowledge made