angular.module('rcmInput').directive(
    'rcmInputLinkUrl',
    [
        '$timeout',
        '$http',
        function ($timeout, $http) {

            var link = function ($scope, element, attributes, ngModelCtrl) {

                $scope.viewValue = '';

                $timeout(
                    function () {
                        $scope.viewValue = ngModelCtrl.$viewValue;
                        $scope.$apply();
                    },
                    0
                );

                var pageUrls = [];

                var sourceUrl = '/rcm-page-search/title';

                $scope.uid = jQuery.fn.generateUUID();

                if (typeof attributes.uid !== 'undefined') {
                    $scope.uid = $scope.$eval(attributes.uid);
                }

                $scope.loading = false;

                $scope.onChange = function() {
                    ngModelCtrl.$setViewValue($scope.viewValue);
                    console.log('onchange');
                };

                var buildAutoComplete = function (response) {

                    for (var key in response.data) {
                        pageUrls.push(key)
                    }

                    // Utilizes jQuery UI autocomplete
                    element.find('input').autocomplete(
                        {
                            source: pageUrls,
                            select: function (event) {
                                $timeout(
                                    function () {
                                        //element.find('input').trigger('input');
                                        $scope.viewValue = event.target.value;
                                        ngModelCtrl.$setViewValue($scope.viewValue);
                                    },
                                    0
                                );
                            }
                        }
                    );

                    $scope.loading = false;
                };

                var getAutoComplete = function () {
                    // prevent duplicate calls
                    if (pageUrls.length > 0) {
                        return;
                    }
                    $scope.loading = true;
                    $http.get(sourceUrl).then(
                        buildAutoComplete
                    );
                };

                var init = function () {
                    getAutoComplete();
                };

                init()
            };

            return {
                link: link,
                scope: {},
                require: 'ngModel',
                templateUrl: '/modules/rcm-admin/rcm-input/rcm-input-link-url.html'
            };
        }
    ]
);

@@ -937,53 +937,8 @@
 e);%0A
-                    console.log('onchange');%0A
     

Add change event for type in