opitzconsulting / jquery-mobile-angular-adapter

jquery mobile angular adapter
MIT License
517 stars 114 forks source link

ng-model not respected inside of directive #31

Closed ghost closed 12 years ago

ghost commented 12 years ago

I'm using a directive with an ng-model on it, but it is not updating the dom or the value when I update it. From below, I can change the ng-model to text or leave it with the huge parent expression, but neither seems to work.

Insight.module.directive('text', [function() { return { restrict: 'E', scope: { parameter: 'accessor' }, template: '', replace: true, compile: function () {

        return function (scope, element, attrs) {
            var control = scope.parameter();

            if (control.DefaultValues && control.DefaultValues.length) {
                control.Value = control.DefaultValues[0];
                scope.text = control.Value;
            }
        }

    }
}

}]);

tbosch commented 12 years ago

Hi, thanks for reporting this. Which version are you using? Could you create a jsfiddle for this? This helps a lot in reproducing the problem.

Tobias

tbosch commented 12 years ago

Sorry, I don't understand the problem you have. Please provide a jsfiddle.

Tobias

ghost commented 12 years ago

You can close this for the moment, I found a work-around that is cleaner, this doesn't appear to be a problem currently for me any more.

tbosch commented 12 years ago

Ok. If you encounter other errors, feel free to open the issue (or another one) again.

Tobias