Learning AngularJs TV SHOW PREMIERES

  • We inject $http in our controller: .controller("mainController", function ($scope, $http) {...}
  • We use ng-init to fill the Data by start: div ng-controller="..." ng-init="init()"
    Our controller gets the data than in this function $scope.init = function () {...}
  • The controller gets the data using jsonp: $http.jsonp(site).success(function (data) {...}
  • We use forEach, to proceed the json-arrays: angular.forEach(data, function (value, index) {...}
    If we need to proceed one Array in another array, than in inner forEach we use value from extern forEach.
  • Ratings: {{tvshow.episode.ratings.loved}} {{tvshow.episode.ratings.hated}} % {{tvshow.episode.ratings.percentage}}

    {{tvshow.show.title}}: {{tvshow.episode.title}}

    {{tvshow.episode.overview}}

    {{tvshow.date}}
    • On Air: {{tvshow.show.air_day}} {{tvshow.show.air_time}}
    • Network: {{tvshow.show.network}}
    • Season #: {{tvshow.episode.season}}
    • Genres: {{genre}}