I am trying to add symbol pallet using AngularJS and following your documentation on the same:
https://help.syncfusion.com/angularjs/diagram/symbol-palette#add-palettes-to-symbolpalette
But When I run the file in Chrome I get the following error: setModel - Invalid input for property :palettes - Expected type - array <div ej-symbolpalette="" id="symbolpalette" e-height="100%" e-width="100%" e-palettes="palettes" e-diagramid="diagramId">
Here is my code:
<!DOCTYPE html>
<html ng-app="defaultApp">
<head>
<link rel="icon" rel='nofollow' href="images/logo.jpg">
<title>Draw Shapes with HTML</title>
<link rel="stylesheet" rel='nofollow' href="http://cdn.syncfusion.com/14.3.0.49/js/web/bootstrap-theme/ej.web.all.min.css" />
<script src="https://code.jquery.com/jquery-3.0.0.min.js"></script>
<script src="http://cdn.syncfusion.com/js/assets/external/jsrender.min.js" type="text/javascript"></script>
<script src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.14.0/jquery.validate.min.js"></script>
<script src="https://code.angularjs.org/1.4.0-rc.2/angular.min.js"></script>
<script src="http://cdn.syncfusion.com/14.3.0.49/js/web/ej.web.all.min.js" type="text/javascript"></script>
<script src="http://js.syncfusion.com/demos/web/scripts/xljsondata.js" type="text/javascript"></script>
<script src="https://code.angularjs.org/1.4.0-rc.2/angular-route.min.js"></script>
<script src="http://cdn.syncfusion.com/14.3.0.49/js/common/ej.widget.angular.min.js"></script>
<script src="http://borismoore.github.io/jsrender/jsrender.min.js"></script>
<script src="./js/draw.js"></script>
</head>
<body>
<div ng-controller="diagramCtrl">
<div ej-symbolpalette id="symbolpalette" e-height="100%" e-width="100%" e-palettes="palettes" e-diagramid="diagramId"></div>
{{palettes}}
<div>
<ej-diagram id="diagram" e-width="100%" e-height="100%">
</ej-diagram>
</div>
</div>
</body>
</html>
My DRAW:JS file code:
var syncApp = angular.module("defaultApp", ["ngRoute", "ejangular"]);
//Defines the JSON to create a palette
var palette = {
//Sets the name of the palette
name: "Basic Shapes",
//Sets whether the palette expands/collapse its children
expanded: true,
};
syncApp.controller('diagramCtrl', function($scope) {
$scope.diagramId = "diagram";
//Defines the palette collection
$scope.palettes = palette;
});
I tried adding the rectangular palette but still get the same error. I can see that the palettes is being filled and displayed in the front end using {{palettes}}. Not sure what I am doing wrong.