I'm unable to get a variable value from directive to use that back in a controller. I do not have to bind the value to a view. All I need is to set 'cleanInputValue' from directive to $scope.keywords in Controller.
Here is my directive and controller -
Html with md-autocomplete for keywords field - search box.
 <form id="searchbox" ng-controller="navsearchController as sc" title="Search this site" layout="row">
          <md-autocomplete
            md-no-cache="true"
            md-selected-item="sc.currentKeyword"
            md-search-text="keywords"
            md-items="item in querySearch(keywords)"
            md-item-text="item.display"
            md-min-length="3"
            md-input-name="search"
            md-input-id="search-nav"
            md-clear-button="false"
            placeholder="Search"
            md-dropdown-position="bottom"
            flex>
            <md-item-template>
              <span md-highlight-text="keywords" md-highlight-flags="gi">{{item.display}}</span>
            </md-item-template>
          </md-autocomplete>
          <div class="search-button" flex="none">
            <button type="submit" ng-click="sc.search()" title="Search" tabindex="0">GO</button>
          </div>
        </form>
Directive:
.directive('test', function () {
    return {
        require: 'ngModel',
        restrict: 'A',
       scope: {
            text: '@text'
        },
        link:function(scope, element, attrs, modelCtrl){
          modelCtrl.$parsers.push(function(inputValue) {
            if (inputValue === undefined){
            return '';
            }
            var cleanInputValue = inputValue.replace(/[^\w\s\-\"]/gi, '');
            if (cleanInputValue != inputValue) {
            modelCtrl.$setViewValue(cleanInputValue);
            modelCtrl.$render();
          }
          return cleanInputValue;
          });
            //console.log(scope.text);
        }
    };
})
Controller:
.controller('navsearchController', function($timeout, $element, $compile, $scope, $rootScope, $http, $location, DataService, $routeParams, $filter, $route){
    var _this = this;
    $timeout(function () {
       var myAutoCompleteInput = 
        angular.element($element[0].querySelector('#search-nav'));
        myAutoCompleteInput.attr("test", "test");
        //myAutoCompleteInput.attr("text", "blah");
         console.log($scope.keywords);
         $compile(myAutoCompleteInput)($scope);
        });
      _this.search = function(){           
       xyzStorage.set('currentKeyword', $scope.keywords);
       $scope.keywords = $filter('removeSpecialChars')($scope.keywords);
       $location.path('/xyz/search/' + $scope.keywords);
      $location.url($location.path());
      $location.search({
        range: xyzStorage.get('itemPerPage'),
      })
      $route.reload();
    };
})
 
    