Skip to content

Commit

Permalink
Adding next tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
blondiebytes committed Sep 5, 2016
1 parent 84677cc commit 7d4362e
Show file tree
Hide file tree
Showing 32 changed files with 87 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added Angular Services in 12 Minutes/.DS_Store
Binary file not shown.
Binary file not shown.
33 changes: 33 additions & 0 deletions Angular Services in 12 Minutes/after/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<DOCTYPE html>

<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.min.js"></script>
</head>
<body ng-app="Trends">

<div ng-controller="MainController">

<h1>Most Popular Stories in Technology</h1>

<div ng-repeat="story in list">
<h3>{{ story.title }}</h3>
<p>{{ story.abstract }}</p>
<a ng-href="{{ story.url }}">Read</a>

<br>
</div>

</div>

<!-- Modules -->
<script type="text/javascript" src="js/app.js"></script>

<!-- Controllers -->
<script src="js/controllers/MainController.js"></script>

<!-- Services -->
<script src="js/services/nyt.js"></script>

</body>
</html>
Binary file not shown.
1 change: 1 addition & 0 deletions Angular Services in 12 Minutes/after/js/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var app = angular.module('Trends', []);
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
app.controller('MainController', ['$scope', 'nyt', function($scope, nyt) {
$scope.list = [];

nyt.success(function(data) {
for (i = 0; i < data.results.length; i++) {
var story = {
title: data.results[i].title,
abstract: data.results[i].abstract,
url: data.results[i].url
}
$scope.list.push(story)
}
})

}]);
Binary file not shown.
13 changes: 13 additions & 0 deletions Angular Services in 12 Minutes/after/js/services/nyt.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
app.factory('nyt', ['$http', function($http) {
return $http.get("https://api.nytimes.com/svc/topstories/v2/technology.json", {params: {'api-key': "keyhere"}})

.success(function(data) {
return data;
})

.error(function(err) {
alert(err)
return err;
})

}])
Binary file not shown.
20 changes: 20 additions & 0 deletions Angular Services in 12 Minutes/before/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<DOCTYPE html>

<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.min.js"></script>
</head>
<body ng-app="Trends">

<div ng-controller="MainController">

</div>

<!-- Modules -->
<script type="text/javascript" src="js/app.js"></script>

<!-- Controllers -->
<script src="js/controllers/MainController.js"></script>

</body>
</html>
Binary file not shown.
1 change: 1 addition & 0 deletions Angular Services in 12 Minutes/before/js/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var app = angular.module('Trends', []);
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
app.controller('MainController', ['$scope', function($scope) {


}]);
Binary file added Basic Angular in 8/.DS_Store
Binary file not shown.
Binary file added Basic Angular in 8/js/.DS_Store
Binary file not shown.
Binary file added Basic Angular in 8/js/controllers/.DS_Store
Binary file not shown.
Binary file added Bootstrap in 5/.DS_Store
Binary file not shown.
Binary file added CSS in 5/.DS_Store
Binary file not shown.
Binary file added DevTools in 5/.DS_Store
Binary file not shown.
Binary file added Directives in 9/.DS_Store
Binary file not shown.
Binary file added Directives in 9/js/.DS_Store
Binary file not shown.
Binary file added Directives in 9/js/controllers/.DS_Store
Binary file not shown.
Binary file added Directives in 9/js/directives/.DS_Store
Binary file not shown.
Binary file added Endpoints with Angular.js in 9/.DS_Store
Binary file not shown.
Binary file added Endpoints with Angular.js in 9/js/.DS_Store
Binary file not shown.
Binary file not shown.
Binary file added HTML in 5/.DS_Store
Binary file not shown.
Binary file added JavaScript in 7/.DS_Store
Binary file not shown.
Binary file added jQuery in 6/.DS_Store
Binary file not shown.

0 comments on commit 7d4362e

Please sign in to comment.