540co/ads-bpa

View on GitHub
client/app/scripts/controllers/splash.js

Summary

Maintainability
A
0 mins
Test Coverage
'use strict';

/**
 * @ngdoc function
 * @name dreApp.controller:SplashCtrl
 * @description
 * # SplashCtrl
 * Controller of the dreApp
 */
angular.module('dreApp')
  .controller('SplashCtrl', ['$scope', '$location', 'DashboardService', function ($scope, $location, DashboardService) {
    $scope.search = function (keyword) {
      $scope.path = $location.path('search').search({'q': keyword});
    };

    $scope.init = function () {
      DashboardService.getSearchTerms().then(function(data){
        $scope.commonSearchTerms = data;
      }, function (error){
        console.log(error);
      });
    };
  }]);