From 1b47ddae7c5e062b0a78820683db06af8cf87a19 Mon Sep 17 00:00:00 2001 From: Aashni Shah Date: Sun, 21 Aug 2016 03:37:12 +0300 Subject: [PATCH] Learn AngularJS with Aashni --- README.md | 1 + learn-angularjs/.DS_Store | Bin 0 -> 6148 bytes learn-angularjs/README.md | 7 +++ learn-angularjs/app.js | 23 +++++++++ learn-angularjs/controllers/character.js | 22 ++++++++ learn-angularjs/controllers/main.js | 38 ++++++++++++++ learn-angularjs/controllers/movie.js | 21 ++++++++ learn-angularjs/index.html | 33 ++++++++++++ learn-angularjs/services/swapi.js | 31 +++++++++++ learn-angularjs/views/character.html | 63 +++++++++++++++++++++++ learn-angularjs/views/main.html | 22 ++++++++ learn-angularjs/views/movie.html | 56 ++++++++++++++++++++ 12 files changed, 317 insertions(+) create mode 100644 learn-angularjs/.DS_Store create mode 100644 learn-angularjs/README.md create mode 100644 learn-angularjs/app.js create mode 100644 learn-angularjs/controllers/character.js create mode 100644 learn-angularjs/controllers/main.js create mode 100644 learn-angularjs/controllers/movie.js create mode 100644 learn-angularjs/index.html create mode 100644 learn-angularjs/services/swapi.js create mode 100644 learn-angularjs/views/character.html create mode 100644 learn-angularjs/views/main.html create mode 100644 learn-angularjs/views/movie.html diff --git a/README.md b/README.md index 991b809..2b325ec 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ Missed an LSH tutorial? Check out the source code & slides here. ### Past Tutorials | Tutorial Title | Location/Time | Speaker Contact Info | Level | Previous Skills Required | | :-------------------: | :-----------: | :------------------: | :---: | :----------------------: | +| [Learn AngularJS](http://blog.aashni.me/2016/08/angularjs-an-introduction/) | [Online, Aug 16th @ 5pm EST](https://www.facebook.com/events/1748805382027851) | contact@aashni.me | Beginner | HTML/CSS and some Javascript would be a bonus | ### Upcoming Tutorials | Tutorial Title | Location/Time | Speaker Contact Info | Level | Previous Skills Required | diff --git a/learn-angularjs/.DS_Store b/learn-angularjs/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 + + + Star Wars App + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + \ No newline at end of file diff --git a/learn-angularjs/services/swapi.js b/learn-angularjs/services/swapi.js new file mode 100644 index 0000000..6232a15 --- /dev/null +++ b/learn-angularjs/services/swapi.js @@ -0,0 +1,31 @@ +var services = angular.module('swapi', []); + +services.factory('SwapiService', ['$http', + function($http){ + function Swapi(){}; + + Swapi.domain = 'http://swapi.co/api'; + + Swapi.people = function(){ + var path = '/people'; + var url = Swapi.domain + path; + + return $http.get(url) + .then(function(response){ + return response; + }); + }; + + Swapi.films = function() { + var path = '/films'; + var url = Swapi.domain + path; + + return $http.get(url) + .then(function(response){ + return response; + }); + }; + + return Swapi; + } +]); \ No newline at end of file diff --git a/learn-angularjs/views/character.html b/learn-angularjs/views/character.html new file mode 100644 index 0000000..b7d39f7 --- /dev/null +++ b/learn-angularjs/views/character.html @@ -0,0 +1,63 @@ +
+ +
+ +
+
+ + + +

Home

+ +

+
+ Name: {{ character.name }} +
+
+
+
+ Height: {{ character.height }} +
+
+
+
+ Mass: {{ character.mass }} +
+
+
+
+ Hair Color: {{ character.hair_color }} +
+
+
+
+ Eye Color: {{ character.eye_color }} +
+
+
+
+ Birth Year: {{ character.birth_year }} +
+
+
+
+ Gender: {{ character.gender }} +
+
+ +
+ +
+ + + + Return Home? + +
+
\ No newline at end of file diff --git a/learn-angularjs/views/main.html b/learn-angularjs/views/main.html new file mode 100644 index 0000000..f0d26f3 --- /dev/null +++ b/learn-angularjs/views/main.html @@ -0,0 +1,22 @@ +
+ + + + + +
\ No newline at end of file diff --git a/learn-angularjs/views/movie.html b/learn-angularjs/views/movie.html new file mode 100644 index 0000000..6e53668 --- /dev/null +++ b/learn-angularjs/views/movie.html @@ -0,0 +1,56 @@ +
+ +
+ +
+
+ + +

Home

+ +

+
+ Name: {{ movie.title }} +
+
+
+
+ Opening Crawl: +

+ {{ movie.opening_crawl }} +

+
+
+
+
+ Director: {{ movie.director }} +
+
+
+
+ Producer: {{ movie.producer }} +
+
+
+
+ Release Date: {{ movie.release_date }} +
+
+ + +
+ +
+ + + + Return Home? + +
+
\ No newline at end of file