Different approaches in declaring module, controller, services etc in AngularJS

Approach 1: Found here
module:
angular.module(‘F1FeederApp’, [‘F1FeederApp.services’,  ‘F1FeederApp.controllers’, ‘ngRoute’]).
config([‘$routeProvider’, function($routeProvider) {
  $routeProvider.
when(“/drivers”, {templateUrl: “partials/drivers.html”, controller: “driversController”}).
when(“/drivers/:id”, {templateUrl: “partials/driver.html”, controller: “driverController”}).
otherwise({redirectTo: ‘/drivers’});

}]);


controller:
angular.module(‘F1FeederApp.controllers’, []).

  /* Drivers controller */
  controller(‘driversController’, function($scope, ergastAPIservice) {
    $scope.nameFilter = null;
    $scope.driversList = [];
    $scope.searchFilter = function (driver) {
        var re = new RegExp($scope.nameFilter, ‘i’);
        return !$scope.nameFilter || re.test(driver.Driver.givenName) || re.test(driver.Driver.familyName);
    };

    ergastAPIservice.getDrivers().success(function (response) {
        //Digging into the response to get the relevant data
        $scope.driversList = response.MRData.StandingsTable.StandingsLists[0].DriverStandings;
    });
  }).

  /* Driver controller */
  controller(‘driverController’, function($scope, $routeParams, ergastAPIservice) {
    $scope.id = $routeParams.id;
    $scope.races = [];
    $scope.driver = null;

    ergastAPIservice.getDriverDetails($scope.id).success(function (response) {
        $scope.driver = response.MRData.StandingsTable.StandingsLists[0].DriverStandings[0]; 
    });

    ergastAPIservice.getDriverRaces($scope.id).success(function (response) {
        $scope.races = response.MRData.RaceTable.Races; 
    }); 

  });

directives
‘use strict’;
/* Directives */
angular.module(‘myApp.directives’, []).
  directive(‘appVersion’, [‘version’, function(version) {
    return function(scope, elm, attrs) {
      elm.text(version);
    };

  }]);

services
angular.module(‘F1FeederApp.services’, [])
  .factory(‘ergastAPIservice’, function($http) {

    var ergastAPI = {};

    ergastAPI.getDrivers = function() {
      return $http({
        method: ‘JSONP’, 
        url: ‘http://ergast.com/api/f1/2013/driverStandings.json?callback=JSON_CALLBACK’
      });
    }

    ergastAPI.getDriverDetails = function(id) {
      return $http({
        method: ‘JSONP’, 
        url: ‘http://ergast.com/api/f1/2013/drivers/’+ id +’/driverStandings.json?callback=JSON_CALLBACK’
      });
    }

    ergastAPI.getDriverRaces = function(id) {
      return $http({
        method: ‘JSONP’, 
        url: ‘http://ergast.com/api/f1/2013/drivers/’+ id +’/results.json?callback=JSON_CALLBACK’
      });
    }

    return ergastAPI;

  });


Advertisements

Bistirno dupare – Vupen Hazarika chords

Guitar Chords:

C
Bistirno dupare, oshonkho manusher
Em G
Hahakar shuneo, nishobde nirobe,
C Em C
O Ganga tumi! Ganga boicho kano? {repeat 1+2}

Em C
Noitikotar skholon dekheo,
Em C
Manobotar poton dekheo,
Em G
Nirlojjo olosh bhabe boicho kano?

C
Shohosro boroshar unmadonaar
G C
Montro diye lokkho jonere,
C Em
Shabal shongraami aar agragaami
C
Korey tolona kano?

C
Bistirno dupare, oshonkho manusher
Em G
Hahakar shuneo, nishobde nirobe,
C Em C
O Ganga tumi! Ganga boicho kano?

Em C
Gyaan-bihin nirokhorer,
Em C
Khaddo-bihin nagorik er,
Em G
Netribihonotay mouno kaano?

C
Shohosro boroshar unmadonaar
G C
Montro diye lokkho jonere,
C Em
Shabal shongraami aar agragaami
C
Korey tolona kano?

C
Bistirno dupare, oshonkho manusher
Em G
Hahakar shuneo, nishobde nirobe,
C Em C
O Ganga tumi! Ganga boicho kano? {repeat 1+2}

Em C
Bekti jodi bekti kendrik,
Em C
Shomoshti jodi bektitto-rohit,
Em G
Tobey shithi shomajke bhango na keno?

C
Shohosro boroshar unmadonaar
G C
Montro diye lokkho jonere,
C Em
Shabal shongraami aar agragaami
C
Korey tolona kano?

C
Bistirno dupare, oshonkho manusher
Em G
Hahakar shuneo, nishobde nirobe,
C Em C
O Ganga tumi! Ganga boicho kano?

Em C
Prodoshwini keno nahi how?
Em C
Tumi nischoy Janhavi now -
Em G
Taholey prorona dao na keno?

C
Unmottotar kurukhetrer
G C
Shoroshojjake alingon kora,
C Em
Lokkho-koti Bharotbashike,
C
Jagale na keno?

C
Bistirno dupare, oshonkho manusher
Em G
Hahakar shuneo, nishobde nirobe,
C Em C
O Ganga tumi! Ganga boicho kano? {repeat 1+1}



Original ScaleC major