rodikh/angular-json-editor

Error: buttons-controller attribute must be a valid controller

cw87 opened this issue · 1 comments

cw87 commented

Hi,

I keep getting this "buttons-controller attribute must be a valid controller" which I have no idea what's the error about.

Here is RuleController which used to load schema from a json file
`angular.module('project1App')
.controller('RuleController', ['$scope', '$http', function ($scope, $http) {

$scope.mySchema = $http.get('assets/json_schema/rule_schema.json');

}]);`

Button Controller
angular.module('project1App') .controller('ruleButtonController', ['$scope', function ($scope) { console.log($scope.editor.getValue()); }]);

Here is my view
`


<button type="submit" class="btn btn-success" ng-click="onSubmit($event)">
        <span class="glyphicon glyphicon-check"></span>
        Submit
    </button>

    <button type="button" class="btn btn-danger" ng-click="onAction2($event)">
        <span class="glyphicon glyphicon-remove"></span>
        Action 2
    </button>

    <button type="button" class="btn btn-primary" ng-click="changeSchema($event)">
        <span class="glyphicon glyphicon-plus"></span>
        Update Schema
    </button>      
</json-editor>
`
cw87 commented

The error was caused by dependency injection.
I dint include my service in the application. Will close this issue