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

Broken on 1.3.2 #73

Closed bilalaslam closed 9 years ago

bilalaslam commented 9 years ago

ui.ace was working on angular-1.3.0-beta.9 but is broken on 1.3.2 with this error:

TypeError: Cannot read property '$formatters' of null
    at link (http://localhost:3041/vendor/angular-ui-ace/ui-ace.js:171:18)
    at invokeLinkFn (http://localhost:3041/vendor/angular/angular.js:8125:9)
    at nodeLinkFn (http://localhost:3041/vendor/angular/angular.js:7637:11)
    at compositeLinkFn (http://localhost:3041/vendor/angular/angular.js:6993:13)
    at nodeLinkFn (http://localhost:3041/vendor/angular/angular.js:7632:24)
    at compositeLinkFn (http://localhost:3041/vendor/angular/angular.js:6993:13)
    at compositeLinkFn (http://localhost:3041/vendor/angular/angular.js:6996:13)
    at publicLinkFn (http://localhost:3041/vendor/angular/angular.js:6872:30)
    at compile (http://localhost:3041/vendor/angular-ui-router/release/angular-ui-router.js:2805:9)
    at invokeLinkFn (http://localhost:3041/vendor/angular/angular.js:8125:9) <div ui-ace="{
          useWrapMode : true,
          showGutter: false,
          theme:'twilight',
          mode: 'sql',
          onLoad: aceLoaded,
          onChange: aceChanged
        }" class=" ace_editor ace-tm"> 
Tadimsky commented 9 years ago

Having the same problem here.

bilalaslam commented 9 years ago

I set ng-model and that "fixed" it.

mohsen1 commented 9 years ago

Thanks @bilalaslam that fixed the issue. But AFIAK ng-model is not mandatory for this

misawsneto commented 9 years ago

+1

ng-model fixed it. But I had to change my code since I was doing things on my controller: $scope.editor.setValue(JSON.stringify(fieldData, null, 2));

I do many things dynamically and I prefer to only set it manually. Well, at least its working... would be glad if anyone fixed it.

ebuildy commented 9 years ago

This is because ng-model is null and function angular.isDefined(ng-model) returns true! I am proposing a fix.