/**
 * Change top "Daily Downloads", "Active Users" values with animation effect
 */
(function () {
    'use strict';

    angular.module('Monitour.theme')
        .directive('matchPassword', matchPassword);

    /** @ngInject */
    function matchPassword() {
        return {
            require: "ngModel",
            scope: {
                otherModelValue: "=matchPassword"
            },
            link: function(scope, element, attributes, ngModel) {

                ngModel.$validators.matchPassword = function(modelValue) {
                    return modelValue == scope.otherModelValue;
                };

                scope.$watch("otherModelValue", function() {
                    ngModel.$validate();
                });
            }
        };

    }

})();