Hi All ,

I am new to angular js and trying to solve one of  the very common issue. 
and i am working on service portal which is newly introduced by servicenow


My HTML Code:

<tags-input ng-model="c.data.watchlistnew" display-property="name" 
placeholder="User Names / IDs" replace-spaces-with-dashes="false" 
add-from-autocomplete-only="true">
                                    <auto-complete
                         source="loadUsers($query,'watchlist')"
                                                 min-length="3"
                                                 load-on-focus="false"
                                                 load-on-empty="false"
                                                 debounce-delay="300"
                                                
 max-results-to-show="10"></auto-complete>
                                    </tags-input>


Controller
function($scope, $http,nowAttachmentHandler, $timeout, $rootScope, spUtil, 
snRecordWatcher, spModal,$sanitize, $window, $sce,$q) {


$scope.loadUsers = function($query, type) {
        
        
        
        var params = {"type" : type,"q": $query};
        var q = encodeURIComponent(params.q);
        
        
        $rootScope.toploader = true;
        $("#"+params.type+" .auto-complete-loader span").show();

        $scope.data.watchlistValue=q;
    
        
        
       
        return spUtil.update($scope).then(function(results) {
            $rootScope.toploader = false;
            $("#"+params.type+" .auto-complete-loader span").hide();

                    return results.watchlistValues;
               });
    }
};


Here i am calling the method loadUsers from html and from controller 
getting the data from server 

result from server is stored in results and i am sending the value back to 
html function but this is not working .


Any help is appreciated .







-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to