'use strict';

SocioboardApp.controller('ConversationBasedController', function ($rootScope, $scope, $http, $timeout, $stateParams, apiDomain, domain) {
    //alert('helo');
    $scope.$on('$viewContentLoaded', function () {
        var nomessages = false;
        var lastreach = false;


        $scope.twtfollower = function () {
          
            $http.get(apiDomain + '/api/Twitter/TwitterConversation?profileId=' + $stateParams.profileId)
                           .then(function (response) {
                              
                               if (response.data == "")
                               {
                                   swal("Sorry no conversations available right now");
                               }
                                   $scope.twtconversationdata = response.data;
                                   $scope.lastreach = true;
                                   $scope.nomessages = true;
                               }, function (reason) {
                                   $scope.error = reason.data;
                               });
                           
        }
        $scope.twtfollower();

    });
});