angular-ui / ui-ace

This directive allows you to add ACE editor elements.
http://angular-ui.github.io/ui-ace
MIT License
578 stars 172 forks source link

Set validity of ngModel #45

Open mren opened 10 years ago

mren commented 10 years ago

Hey,

what would be the best way to set the validity of ngModel, based on the value of getAnnotations?

I can access the getAnntations values by doing the following in my controller

$scope.aceLoaded = function(editor) {
  editor.getSession().on('changeAnnotation', function() {
    var annot = editor.getSession().getAnnotations();
  });
};

Within the uiAcedirective it would be possible to set the validity of the model by calling ngModel.$setValidity('annotations', isValid)

Whats your opinion about implementing this within the uiAce directive?

Bests, Mark

chachou29 commented 10 years ago

hello, Yes, it would be great to set validity of the form if ace editor has error annotations. Philippe

scampi commented 8 years ago

what is the status of this issue ? I find the need of marking the editor as invalid as well.

cvharris commented 8 years ago

+1

bjaraujo commented 8 years ago

+1

dradovic commented 8 years ago

+1

dtseng123 commented 8 years ago

+1

ConsM commented 6 years ago

+1