Closed mabuonomo closed 6 years ago
Hi, I have some problem with create a dommand
This is my code
<textarea froala froala-init="myControllerFunction(initControls)" class="form-control no-resize auto-growth" name="description" id="description" ng-model="$parent.model.description"></textarea>
$scope.myControllerFunction = function (initControls) { initControls.initialize(); var editor = initControls.getEditor(); editor.DefineIcon("myDropdown", { NAME: "myDropdown" }); editor.RegisterCommand("myDropdown", { title: "Example", type: "dropdown", icon: "dropdownIcon", focus: true, undo: true, refreshAfterCallback: true, options: { "v1": "Option 1", "v2": "Option 2" }, callback: function (cmd, val) { console.log(val); }, // Callback on refresh. refresh: function ($btn) { console.log("do refresh"); }, // Callback on dropdown show. refreshOnShow: function ($btn, $dropdown) { console.log("do refresh when show"); } }); // }); }
The error is:
editor.DefineIcon is not a function
editor is not undefined
Thanks
@mabuonomo you should define the new button before initializing the editor just as described in our docs, by using $.FroalaEditor.RegisterCommand.
Hi, I have some problem with create a dommand
This is my code
<textarea froala froala-init="myControllerFunction(initControls)" class="form-control no-resize auto-growth" name="description" id="description" ng-model="$parent.model.description"></textarea>
The error is:
editor is not undefined
Thanks